diff --git a/CMakeLists.txt b/CMakeLists.txt index f051e49c6..5ccc8b1c8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -340,16 +340,20 @@ file( RELATIVE_PATH CONF_REL_INCLUDE_DIR "${CMAKE_INSTALL_FULL_CMAKEDIR}" "${CMA configure_file( CalamaresConfig.cmake.in "${PROJECT_BINARY_DIR}/CalamaresConfig.cmake" @ONLY ) configure_file( CalamaresConfigVersion.cmake.in "${PROJECT_BINARY_DIR}/CalamaresConfigVersion.cmake" @ONLY ) +configure_file( CalamaresUse.cmake.in "${PROJECT_BINARY_DIR}/CalamaresUse.cmake" @ONLY ) # Install the cmake files install( FILES "${PROJECT_BINARY_DIR}/CalamaresConfig.cmake" "${PROJECT_BINARY_DIR}/CalamaresConfigVersion.cmake" + "${PROJECT_BINARY_DIR}/CalamaresUse.cmake" "CMakeModules/CalamaresAddPlugin.cmake" "CMakeModules/CalamaresAddModuleSubdirectory.cmake" "CMakeModules/CalamaresAddLibrary.cmake" "CMakeModules/CalamaresAddBrandingSubdirectory.cmake" + "CMakeModules/CalamaresAddTranslations.cmake" + "CMakeModules/CMakeColors.cmake" DESTINATION "${CMAKE_INSTALL_CMAKEDIR}" ) diff --git a/CalamaresUse.cmake.in b/CalamaresUse.cmake.in new file mode 100644 index 000000000..474704ec1 --- /dev/null +++ b/CalamaresUse.cmake.in @@ -0,0 +1,29 @@ +# A setup-cmake-things-for-Calamares module. +# +# This module handles looking for dependencies and including +# all of the Calamares macro modules, so that you can focus +# on just using the macros to build Calamares modules. +# Typical use looks like this: +# +# ``` +# find_package( Calamares REQUIRED ) +# include( "${CALAMARES_CMAKE_DIR}/CalamaresUse.cmake" ) +# ``` +# +# The first CMake command finds Calamares (which will contain +# this file), then adds the found location to the search path, +# and then includes this file. After that, you can use +# Calamares module and plugin macros. + +if( NOT CALAMARES_CMAKE_DIR ) + message( FATAL_ERROR "Use find_package(Calamares) first." ) +endif() +set( CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CALAMARES_CMAKE_DIR} ) + +find_package( Qt5 @QT_VERSION@ CONFIG REQUIRED Core Widgets ) + +include( CalamaresAddLibrary ) +include( CalamaresAddModuleSubdirectory ) +include( CalamaresAddPlugin ) +include( CalamaresAddBrandingSubdirectory ) +