diff --git a/CMakeLists.txt b/CMakeLists.txt index d495ae439..817e7e0c6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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)