From 765cb72b7abbf93dd43d245130e8203b34ab3900 Mon Sep 17 00:00:00 2001 From: scarrazza Date: Fri, 19 Jan 2024 22:17:18 +0100 Subject: [PATCH 1/3] general fixes --- capi/CMakeLists.txt | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/capi/CMakeLists.txt b/capi/CMakeLists.txt index c01dadd..8593a27 100644 --- a/capi/CMakeLists.txt +++ b/capi/CMakeLists.txt @@ -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) @@ -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" @@ -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) \ No newline at end of file +install(TARGETS pdfflow LIBRARY DESTINATION ${CMAKE_INSTALL_PREFIX}/lib) From 3f86438c886eeb6003b4479d23fa18d1e7c88140 Mon Sep 17 00:00:00 2001 From: "Juan M. Cruz-Martinez" Date: Mon, 22 Jan 2024 15:17:08 +0100 Subject: [PATCH 2/3] Update README.md with reference to DYLD for macos --- capi/README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/capi/README.md b/capi/README.md index df96a8a..4095995 100644 --- a/capi/README.md +++ b/capi/README.md @@ -21,10 +21,11 @@ pkg-config pdfflow --cflags pkg-config pdfflow --libs ``` -If you installed to a non-standard location, you need to set up the `PKG_CONFIG_PATH` and `LD_LIBRARY_PATH`, e.g.: +If you installed to a non-standard location, you need to set up the `PKG_CONFIG_PATH` and `LD_LIBRARY_PATH`, e.g., for a `VIRTUAL_ENV`: ```bash export PKG_CONFIG_PATH=${VIRTUAL_ENV}/lib/pkgconfig/:${PKG_CONFIG_PATH}: export LD_LIBRARY_PATH=${VIRTUAL_ENV}/lib/:${LD_LIBRARY_PATH}: +export DYLD_LIBRARY_PATH=${VIRTUAL_ENV}/lib:${DYLD_LIBRARY_PATH}Ñ ``` From af869d1ccba552a719cfe72e52810d2dc86d4d12 Mon Sep 17 00:00:00 2001 From: "Juan M. Cruz-Martinez" Date: Mon, 22 Jan 2024 15:59:59 +0100 Subject: [PATCH 3/3] Update capi/README.md Co-authored-by: Stefano Carrazza --- capi/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/capi/README.md b/capi/README.md index 4095995..26bc208 100644 --- a/capi/README.md +++ b/capi/README.md @@ -25,7 +25,7 @@ If you installed to a non-standard location, you need to set up the `PKG_CONFIG_ ```bash export PKG_CONFIG_PATH=${VIRTUAL_ENV}/lib/pkgconfig/:${PKG_CONFIG_PATH}: export LD_LIBRARY_PATH=${VIRTUAL_ENV}/lib/:${LD_LIBRARY_PATH}: -export DYLD_LIBRARY_PATH=${VIRTUAL_ENV}/lib:${DYLD_LIBRARY_PATH}Ñ +export DYLD_LIBRARY_PATH=${VIRTUAL_ENV}/lib:${DYLD_LIBRARY_PATH}: ```