CMake: put CMake-level ABI settings in CalamaresConfig

- drop the BuildTreeSettings, it was not usefully used
- make CalamaresConfig repeat the WITH_* settings, so that
  consumers can know the ABI offered
This commit is contained in:
Adriaan de Groot 2020-06-10 11:51:53 +02:00
parent 6c272bc8be
commit 23c93904df
4 changed files with 20 additions and 11 deletions

View File

@ -543,10 +543,6 @@ set( CMAKE_INSTALL_CMAKEDIR "${CMAKE_INSTALL_LIBDIR}/cmake/Calamares" CACHE PATH
set( CMAKE_INSTALL_FULL_CMAKEDIR "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_CMAKEDIR}" )
export( PACKAGE Calamares )
configure_file(
CalamaresBuildTreeSettings.cmake.in
"${PROJECT_BINARY_DIR}/CalamaresBuildTreeSettings.cmake" @ONLY
)
configure_package_config_file(
"CalamaresConfig.cmake.in"
"${PROJECT_BINARY_DIR}/CalamaresConfig.cmake"

View File

@ -1,4 +0,0 @@
set(CALAMARES_INCLUDE_DIRS
"@PROJECT_SOURCE_DIR@/src/libcalamares"
"@PROJECT_BINARY_DIR@/src/libcalamares"
)

View File

@ -62,7 +62,17 @@ set(Calamares_LIBRARIES Calamares::calamares)
#
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR})
include(CalamaresAddBrandingSubdirectory)
include(CalamaresAddLibrary)
include(CalamaresAddModuleSubdirectory)
include(CalamaresAddPlugin)
include(CalamaresAddBrandingSubdirectory)
# These are feature-settings that affect consumers of Calamares
# libraries as well; without Python-support in the libs, for instance,
# there's no point in having a Python plugin.
#
# This list should match the one in libcalamares/CalamaresConfig.h,
# which is the C++-language side of the same configuration.
set(Calamares_WITH_PYTHON @WITH_PYTHON@)
set(Calamares_WITH_PYTHONQT @WITH_PYTHONQT@)
set(Calamares_WITH_QML @WITH_QML@)

View File

@ -29,7 +29,14 @@
#define CMAKE_INSTALL_FULL_DATADIR "${CMAKE_INSTALL_FULL_DATADIR}/calamares"
#define CMAKE_INSTALL_FULL_SYSCONFDIR "${CMAKE_INSTALL_FULL_SYSCONFDIR}"
//cmakedefines for CMake variables (e.g. for optdepends) go here
/*
* These are feature-settings that affect consumers of Calamares
* libraries as well; without Python-support in the libs, for instance,
* there's no point in having a Python plugin.
*
* This list should match the one in CalamaresConfig.cmake
* which is the CMake-time side of the same configuration.
*/
#cmakedefine WITH_PYTHON
#cmakedefine WITH_PYTHONQT
#cmakedefine WITH_QML