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
wilder-pre-rebase
Martin Gräßlin 10 years ago
parent 2201f90bd4
commit 7996fb97d3
  1. 8
      BreezeConfig.cmake.in
  2. 19
      CMakeLists.txt

@ -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()

@ -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)

Loading…
Cancel
Save