CMake: be more noisy about python technologies

- log enabled and disabled features
- enabled python gets logged twice, that's fine
This commit is contained in:
Adriaan de Groot 2024-02-24 21:27:45 +01:00
parent 809d6cdda0
commit dbddeaba68
3 changed files with 10 additions and 1 deletions

View File

@ -455,9 +455,11 @@ if(NOT Python_Development_FOUND)
message(STATUS "Disabling Python modules")
set(WITH_PYTHON OFF)
set(WITH_PYBIND11 OFF)
set(WITH_BOOST_PYTHON OFF)
endif()
if(WITH_PYTHON AND NOT WITH_PYBIND11)
set(WITH_BOOST_PYTHON ON)
find_package(boost_python)
if(NOT TARGET Boost::python)
find_package(Boost ${BOOSTPYTHON_VERSION} COMPONENTS python)
@ -470,12 +472,16 @@ if(WITH_PYTHON AND NOT WITH_PYBIND11)
set(Boost_FOUND ON)
endif()
endif()
add_feature_info(python WITH_PYTHON "Enable Python-modules")
add_feature_info(python-pybind11 WITH_PYBIND11 "Python-modules through pybind11")
add_feature_info(python-boost WITH_BOOST_PYTHON "Python-modules through Boost::Python")
# Now we know the state of the ABI-options, copy them into "Calamares_"
# prefixed variables, to match how the variables would-be-named
# when building out-of-tree.
set(Calamares_WITH_PYBIND11 ${WITH_PYBIND11})
set(Calamares_WITH_PYTHON ${WITH_PYTHON})
set(Calamares_WITH_PYBIND11 ${WITH_PYBIND11})
set(Calamares_WITH_BOOST_PYTHON ${WITH_BOOST_PYTHON})
set(Calamares_WITH_QML ${WITH_QML})
set(Calamares_WITH_QT6 ${WITH_QT6})
@ -715,6 +721,7 @@ endif()
get_directory_property(SKIPPED_MODULES DIRECTORY src/modules DEFINITION LIST_SKIPPED_MODULES)
calamares_explain_skipped_modules( ${SKIPPED_MODULES} )
feature_summary(WHAT ENABLED_FEATURES DESCRIPTION "The following features are enabled" QUIET_ON_EMPTY)
feature_summary(WHAT DISABLED_FEATURES DESCRIPTION "The following features have been disabled:" QUIET_ON_EMPTY)
feature_summary(
WHAT OPTIONAL_PACKAGES_NOT_FOUND

View File

@ -95,5 +95,6 @@ include(CalamaresAddPlugin)
# which is the C++-language side of the same configuration.
set(Calamares_WITH_PYTHON @WITH_PYTHON@)
set(Calamares_WITH_PYBIND11 @WITH_PYBIND11@)
set(Calamares_WITH_BOOST_PYTHON @WITH_BOOST_PYTHON@)
set(Calamares_WITH_QML @WITH_QML@)
set(Calamares_WITH_QT6 @WITH_QT6@)

View File

@ -26,6 +26,7 @@
*/
#cmakedefine WITH_PYTHON
#cmakedefine WITH_PYBIND11
#cmakedefine WITH_BOOST_PYTHON
#cmakedefine WITH_QML
#cmakedefine WITH_QT6