From 7996fb97d314f64115b2d712bb93e83988ac99f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Gr=C3=A4=C3=9Flin?= Date: Thu, 7 Apr 2016 13:34:15 +0200 Subject: [PATCH] Create a BreezeConfig.cmake Summary: Breeze creates and installs a BreezeConfig.cmake and BreezeConfigVersion.cmake. The idea is to have other Plasma projects which default to Breeze items (e.g. kstyle in plamsa-integration, kdecoration in KWin) to properly depend on it. The content of the BreezeConfig.cmake so far provides whether Breeze is compiled with support for KDecoration and the plugin id. This can now be used by e.g. KWin in the following way: find_package(Breeze ${PROJECT_VERSION} CONFIG) set_package_properties(Breeze PROPERTIES TYPE OPTIONAL PURPOSE "For setting the default window decoration plugin") add_feature_info("Breeze-Decoration" BREEZE_WITH_KDECORATION "Default decoration plugin Breeze") Reviewers: #plasma Differential Revision: https://phabricator.kde.org/D1343 --- BreezeConfig.cmake.in | 8 ++++++++ CMakeLists.txt | 19 +++++++++++++++++++ 2 files changed, 27 insertions(+) create mode 100644 BreezeConfig.cmake.in diff --git a/BreezeConfig.cmake.in b/BreezeConfig.cmake.in new file mode 100644 index 00000000..69bbe074 --- /dev/null +++ b/BreezeConfig.cmake.in @@ -0,0 +1,8 @@ +@PACKAGE_INIT@ + +set(BREEZE_WITH_KDECORATION @WITH_DECORATIONS@) +if(${BREEZE_WITH_KDECORATION}) + set(BREEZE_KDECORATION_PLUGIN_ID "org.kde.breeze") +else() + set(BREEZE_KDECORATION_PLUGIN_ID "") +endif() diff --git a/CMakeLists.txt b/CMakeLists.txt index ac91130d..5ef6ab30 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -42,6 +42,25 @@ else() find_package(KF5I18n CONFIG REQUIRED) ki18n_install(po) endif() + + include(ECMSetupVersion) + ecm_setup_version(${PROJECT_VERSION} VARIABLE_PREFIX BREEZE + PACKAGE_VERSION_FILE "${CMAKE_CURRENT_BINARY_DIR}/BreezeConfigVersion.cmake" + ) + + # create a Config.cmake and a ConfigVersion.cmake file and install them + set(CMAKECONFIG_INSTALL_DIR "${CMAKECONFIG_INSTALL_PREFIX}/Breeze") + + ecm_configure_package_config_file("${CMAKE_CURRENT_SOURCE_DIR}/BreezeConfig.cmake.in" + "${CMAKE_CURRENT_BINARY_DIR}/BreezeConfig.cmake" + INSTALL_DESTINATION ${CMAKECONFIG_INSTALL_DIR} + ) + + install(FILES "${CMAKE_CURRENT_BINARY_DIR}/BreezeConfig.cmake" + "${CMAKE_CURRENT_BINARY_DIR}/BreezeConfigVersion.cmake" + DESTINATION "${CMAKECONFIG_INSTALL_DIR}" + COMPONENT Devel + ) endif() feature_summary(WHAT ALL INCLUDE_QUIET_PACKAGES FATAL_ON_MISSING_REQUIRED_PACKAGES)