From e7e0014cf8263535e20fa5ddb30463e5f23c459f Mon Sep 17 00:00:00 2001 From: mark heath Date: Sat, 8 Jul 2017 23:52:51 +1000 Subject: [PATCH 1/2] Fixes to build on MacOSX addresses #20 and #21 --- CMakeLists.txt | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 4b6df3f..c964a58 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -27,16 +27,30 @@ if (NOT BUILD_TYPE) set(CMAKE_BUILD_TYPE Debug) endif(NOT BUILD_TYPE) +if (APPLE) + set(CMAKE_MACOSX_RPATH 1) + set(SED_COMMAND sed -E) +else(APPLE) + set(SED_COMMAND sed -r) +endif() + # this figures out the Python include directories and adds them to the # header file search path execute_process( COMMAND python-config --includes - COMMAND sed -r "s/-I//g; s/ +/;/g" + COMMAND ${SED_COMMAND} "s/-I//g; s/ +/;/g" COMMAND tr -d '\n' OUTPUT_VARIABLE Python_Includes ) message(STATUS "Python include dir:" ${Python_Includes}) +execute_process( + COMMAND python-config --libs + COMMAND tr -d '\n' + OUTPUT_VARIABLE Python_Link_Flags +) +message(STATUS "Python link flags:" ${Python_Link_Flags}) + include_directories(${Python_Includes}) include_directories(${CMAKE_CURRENT_SOURCE_DIR}) @@ -166,6 +180,7 @@ else (USE_CLIPPER_FOR_PYTHON) endif (USE_CLIPPER_FOR_PYTHON) target_link_libraries(area ${Boost_LIBRARIES}) set_target_properties(area PROPERTIES PREFIX "") +set_target_properties(area PROPERTIES LINK_FLAGS "${Python_Link_Flags}") # this figures out where to install the Python modules execute_process( From edeec3b88f906fc19c585236b0b7bff6f03bde4d Mon Sep 17 00:00:00 2001 From: Mark Heath Date: Fri, 14 Jul 2017 15:10:10 +1000 Subject: [PATCH 2/2] Changes for python-config flags --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index c964a58..016518c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -45,7 +45,7 @@ execute_process( message(STATUS "Python include dir:" ${Python_Includes}) execute_process( - COMMAND python-config --libs + COMMAND python-config --ldflags COMMAND tr -d '\n' OUTPUT_VARIABLE Python_Link_Flags )