I give up

This commit is contained in:
Maarten L. Hekkelman
2026-01-31 15:52:50 +01:00
parent 1dbc5eea63
commit ffa9733b03

View File

@@ -34,39 +34,14 @@ if(NOT EXISTS ${Python_LIBRARIES})
message(FATAL_ERROR "The python library ${Python_LIBRARIES} does not seem to exist?")
endif()
find_package(Boost 1.86 REQUIRED COMPONENTS python)
# ---------
add_library(mkdssp_module SHARED dssp-python-plugin.cpp)
target_compile_features(mkdssp_module PUBLIC cxx_std_20)
target_include_directories(mkdssp_module PRIVATE ${Python_INCLUDE_DIRS})
target_link_libraries(mkdssp_module dssp::dssp ${Python_LIBRARIES})
# Boost 1.86 is required since it contains code required to use numpy 2.x
if(NOT WIN32) # On Windows we need to build boost ourselves, to find the correct python lib
find_package(Boost 1.86 QUIET COMPONENTS python)
if (boost_FOUND)
target_link_libraries(mkdssp_module Boost::python)
endif()
endif()
if(WIN32 OR NOT boost_FOUND)
# boost is a huge project and directly downloading the 'alternate release'
# from github is much faster than recursively cloning the repo.
CPMAddPackage(
NAME Boost
VERSION 1.90.0
URL https://archives.boost.io/release/1.90.0/source/boost_1_90_0.tar.bz2
URL_HASH SHA256=49551aff3b22cbc5c5a9ed3dbc92f0e23ea50a0f7325b0d198b705e8ee3fc305
OPTIONS
"BOOST_ENABLE_CMAKE ON"
"BOOST_INCLUDE_LIBRARIES python"
"BOOST_ENABLE_PYTHON ON"
"CMAKE_POSITION_INDEPENDENT_CODE ON"
)
target_link_libraries(mkdssp_module Boost)
endif()
target_link_libraries(mkdssp_module PRIVATE dssp::dssp ${Python_LIBRARIES} Boost::python)
set_target_properties(mkdssp_module
PROPERTIES
@@ -82,7 +57,7 @@ if(WIN32)
mkdssp_module
PROPERTIES
SUFFIX ".pyd"
RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin )
RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
install(TARGETS mkdssp_module RUNTIME DESTINATION "${Python_SITELIB}")
else()