CMake: find boost_python as well

On FreeBSD, at least, `find_package(Boost COMPONENTS python)`
doesn't work well, while `find_package(boost_python)` does the job.

Be somewhat more flexible: look for boost_python first, assuming
it pulls in the rest of the Boost bits it needs.
This commit is contained in:
Adriaan de Groot 2022-05-10 11:16:24 +02:00
parent 52e2c8c262
commit 0d3e5e1c26

View File

@ -390,8 +390,14 @@ endif()
add_feature_info(yaml-schema BUILD_SCHEMA_TESTING "Validate YAML (config files) with schema.${_schema_explanation}")
if(Python_Development_FOUND)
find_package(Boost ${BOOSTPYTHON_VERSION} COMPONENTS python)
set_package_properties(Boost PROPERTIES PURPOSE "Boost.Python is used for Python job modules.")
find_package(boost_python)
if(NOT TARGET Boost::python)
find_package(Boost ${BOOSTPYTHON_VERSION} COMPONENTS python)
set_package_properties(Boost PROPERTIES PURPOSE "Boost.Python is used for Python job modules.")
else()
message(STATUS "Found boost_python with target Boost::python")
set(Boost_FOUND ON)
endif()
endif()
if(NOT Python_Development_FOUND OR NOT Boost_FOUND)