Skip to content

Commit

Permalink
general fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
scarrazza committed Jan 19, 2024
1 parent 6c0110d commit 765cb72
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions capi/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required (VERSION 3.0.2)
cmake_minimum_required (VERSION 3.0.2...3.28.1)

# Use rpaths for now, previously there were issues with osx
SET(CMAKE_SKIP_BUILD_RPATH FALSE)
Expand All @@ -13,25 +13,25 @@ project(libpdfflow)

set(VERSION "\"0.1\"")

find_package(PythonInterp 3 REQUIRED)
find_package(PythonLibs 3 REQUIRED)
find_package(Python3 COMPONENTS Interpreter Development)

# running the cffi builder
if (NOT EXISTS ${PROJECT_SOURCE_DIR/src/cpdfflow.cc})
execute_process(COMMAND ${PYTHON_EXECUTABLE} ${PROJECT_SOURCE_DIR}/src/build.py WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}/src)
execute_process(COMMAND ${Python3_EXECUTABLE} ${PROJECT_SOURCE_DIR}/src/build.py WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}/src)
endif()

include_directories(${PYTHON_INCLUDE_DIRS})
include_directories(${Python3_INCLUDE_DIRS})
include_directories(src)
add_library(pdfflow SHARED ${PROJECT_SOURCE_DIR}/src/cpdfflow.c)
target_link_libraries(pdfflow ${Python3_LIBRARIES})

# pkg-config
set(prefix ${CMAKE_INSTALL_PREFIX})
set(exec_prefix "${prefix}")
set(includedir "${prefix}/include")
set(extraincludirs "-I${PYTHON_INCLUDE_DIR}")
set(extraincludirs "-I${Python3_INCLUDE_DIRS}")
set(libdir "${prefix}/lib")
set(pythonlibs "${PYTHON_LIBRARIES}")
set(pythonlibs "${Python3_LIBRARIES}")

configure_file(
"${PROJECT_SOURCE_DIR}/src/pdfflow.pc.in"
Expand All @@ -40,4 +40,4 @@ configure_file(

install(FILES ${PROJECT_SOURCE_DIR}/src/pdfflow.pc DESTINATION ${CMAKE_INSTALL_PREFIX}/lib/pkgconfig)
install(DIRECTORY ${PROJECT_SOURCE_DIR}/src/pdfflow DESTINATION ${CMAKE_INSTALL_PREFIX}/include)
install(TARGETS pdfflow LIBRARY DESTINATION ${CMAKE_INSTALL_PREFIX}/lib)
install(TARGETS pdfflow LIBRARY DESTINATION ${CMAKE_INSTALL_PREFIX}/lib)

0 comments on commit 765cb72

Please sign in to comment.