Commit 4a4fd91a authored by Joost van Amersfoort's avatar Joost van Amersfoort Committed by Davis E. King

remove linking to libpython on linux/OSX (#703)

* remove linking to libpython on linux

* add OSX libpython free building

* add automatic discovery of include python dir back in

* make the libs non required for building on manylinux
parent be8b5cd0
......@@ -69,10 +69,10 @@ if (PYTHON3)
FIND_PACKAGE(Boost 1.41.0 COMPONENTS python)
endif()
set(Python_ADDITIONAL_VERSIONS 3.5 3.6)
FIND_PACKAGE(PythonLibs 3.4 REQUIRED)
FIND_PACKAGE(PythonLibs 3.4)
else()
FIND_PACKAGE(Boost 1.41.0 COMPONENTS python)
FIND_PACKAGE(PythonLibs 2.6 REQUIRED)
FIND_PACKAGE(PythonLibs 2.6)
endif()
if (NOT Boost_FOUND)
......@@ -126,7 +126,6 @@ else()
endif()
message(STATUS "USING BOOST_LIBS: ${Boost_LIBRARIES}")
message(STATUS "USING PYTHON_LIBS: ${PYTHON_LIBRARIES}")
if (CMAKE_COMPILER_IS_GNUCXX)
# Just setting CMAKE_POSITION_INDEPENDENT_CODE should be enough to set
......@@ -148,7 +147,8 @@ include(${CMAKE_CURRENT_LIST_DIR}/../cmake)
# output name is set to what the user asked for (i.e. no _).
macro(add_python_module module_name module_sources )
ADD_LIBRARY(${module_name}_ SHARED ${module_sources} ${ARGN} )
TARGET_LINK_LIBRARIES(${module_name}_ ${Boost_LIBRARIES} ${PYTHON_LIBRARIES} dlib::dlib)
TARGET_LINK_LIBRARIES(${module_name}_ ${Boost_LIBRARIES} dlib::dlib)
if(WIN32 AND NOT CYGWIN)
SET_TARGET_PROPERTIES( ${module_name}_
PROPERTIES
......@@ -163,9 +163,18 @@ macro(add_python_module module_name module_sources )
SUFFIX ".dll"
OUTPUT_NAME ${module_name}
)
elseif(APPLE)
SET_TARGET_PROPERTIES( ${module_name}_
PROPERTIES
LINK_FLAGS "-undefined dynamic_lookup"
PREFIX ""
SUFFIX ".so"
OUTPUT_NAME ${module_name}
)
else()
SET_TARGET_PROPERTIES( ${module_name}_
PROPERTIES
LINK_FLAGS "-shared"
PREFIX ""
SUFFIX ".so"
OUTPUT_NAME ${module_name}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment