Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use new CMake Python discovery, with matching Boost::Python abi. #207

Merged
merged 1 commit into from
Oct 30, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 2 additions & 18 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,29 +8,13 @@ set(CMAKE_CXX_FLAGS_DEBUG "-O0")

################################################################################

find_package(PythonLibs 3.3 REQUIRED)
find_package(Python 3.3 REQUIRED COMPONENTS Interpreter Development)

if (WIN32)
add_definitions("-DBOOST_PYTHON_STATIC_LIB")
endif()

if (WIN32)
find_package(Boost REQUIRED COMPONENTS python3)
elseif (APPLE)
foreach (PYTHON_NAME python3 python36 python37)
find_package(Boost QUIET COMPONENTS ${PYTHON_NAME})
if (${Boost_FOUND})
break()
endif()
endforeach()
elseif (UNIX)
foreach (PYTHON_NAME python3 python-py36 python-py35 python-py34)
find_package(Boost QUIET COMPONENTS ${PYTHON_NAME})
if (${Boost_FOUND})
break()
endif()
endforeach()
endif()
find_package(Boost REQUIRED COMPONENTS python${Python_VERSION_MAJOR}${Python_VERSION_MINOR})

if (NOT ${Boost_FOUND})
message(FATAL_ERROR "Could not find boost::python3")
Expand Down
2 changes: 1 addition & 1 deletion app/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ add_definitions(-D'GITREV="${GITREV}${GITDIFF}"'
################################################################################

target_include_directories(${ANTIMONY_APP} SYSTEM PRIVATE
${PYTHON_INCLUDE_DIRS}
${Python_INCLUDE_DIR}
${Boost_INCLUDE_DIRS}
${AUTOGEN_TARGETS_FOLDER}
)
Expand Down
6 changes: 3 additions & 3 deletions lib/fab/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ add_library(SbFab STATIC
)

target_include_directories(SbFab SYSTEM PRIVATE
${PYTHON_INCLUDE_DIRS}
${Python_INCLUDE_DIR}
${Boost_INCLUDE_DIRS}
${PNG_INCLUDE_DIR}
)
Expand All @@ -79,7 +79,7 @@ target_include_directories(SbFab PRIVATE

target_link_libraries(SbFab
${Boost_LIBRARIES}
${PYTHON_LIBRARY}
${Python_LIBRARY_RELEASE}
${PNG_LIBRARIES}
)
target_include_directories(SbFab PUBLIC inc)
Expand All @@ -98,7 +98,7 @@ target_link_libraries(SbFabTest SbFab)
target_include_directories(SbFabTest SYSTEM PRIVATE
../../vendor
${Boost_INCLUDE_DIRS}
${PYTHON_INCLUDE_DIRS}
${Python_INCLUDE_DIR}
)

################################################################################
Expand Down
6 changes: 3 additions & 3 deletions lib/graph/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ add_library(SbGraph STATIC
)

target_include_directories(SbGraph SYSTEM PRIVATE
${PYTHON_INCLUDE_DIRS}
${Python_INCLUDE_DIR}
${Boost_INCLUDE_DIRS}
)
target_link_libraries(SbGraph
${Boost_LIBRARIES}
${PYTHON_LIBRARY}
${Python_LIBRARY_RELEASE}
)
target_include_directories(SbGraph PUBLIC inc)

Expand All @@ -38,7 +38,7 @@ add_executable(SbGraphTest
target_link_libraries(SbGraphTest SbGraph)

target_include_directories(SbGraphTest SYSTEM PRIVATE
${PYTHON_INCLUDE_DIRS}
${Python_INCLUDE_DIR}
${Boost_INCLUDE_DIRS}
../../vendor
)
Expand Down