Build private boost version if not found

This commit is contained in:
Maarten L. Hekkelman
2025-05-15 08:28:32 +02:00
parent 0a2da70235
commit 0469b0387c
4 changed files with 1318 additions and 14 deletions

View File

@@ -27,7 +27,25 @@ if(CMAKE_VERSION GREATER_EQUAL 3.30)
endif()
find_package(Python REQUIRED COMPONENTS Interpreter Development)
find_package(Boost 1.83 REQUIRED COMPONENTS python)
find_package(Boost 1.83 QUIET COMPONENTS python)
if(NOT Boost_FOUND)
include(CPM)
# 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.84.0
URL https://github.com/boostorg/boost/releases/download/boost-1.84.0/boost-1.84.0.tar.xz
URL_HASH SHA256=2e64e5d79a738d0fa6fb546c6e5c2bd28f88d268a2a080546f74e5ff98f29d0e
OPTIONS
"BOOST_ENABLE_CMAKE ON"
"BOOST_INCLUDE_LIBRARIES python"
"BOOST_ENABLE_PYTHON ON"
"CMAKE_POSITION_INDEPENDENT_CODE ON"
)
endif()
# ---------
add_library(mkdssp_module SHARED dssp-python-plugin.cpp)