From 0677747fb29f8a0e28df3720a6de1b5183c62f3b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20K=C3=BCgler?= Date: Fri, 3 May 2013 01:14:19 +0200 Subject: [PATCH] create and install PlasmaConfig.cmake --- CMakeLists.txt | 35 +++++++++++++++++++++++++++++++++-- PlasmaConfig.cmake.in | 12 ++++++++++++ 2 files changed, 45 insertions(+), 2 deletions(-) create mode 100644 PlasmaConfig.cmake.in diff --git a/CMakeLists.txt b/CMakeLists.txt index 267ea7890..411a07885 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -158,8 +158,39 @@ macro(installPackage dir component) install(FILES ${dir}/metadata.desktop DESTINATION ${SERVICES_INSTALL_DIR} RENAME plasma-${type}-${component}.desktop) endmacro() +################ create PlasmaConfig.cmake and install it ########################### + + +# create a Config.cmake and a ConfigVersion.cmake file and install them +set(CMAKECONFIG_INSTALL_DIR "${CMAKECONFIG_INSTALL_PREFIX}/Plasma") + +include(CMakePackageConfigHelpers) + +include(ECMSetupVersion) +ecm_setup_version(2 0 0 VARIABLE_PREFIX PLASMA + VERSION_HEADER "${CMAKE_CURRENT_BINARY_DIR}/plasma_version.h" + PACKAGE_VERSION_FILE "${CMAKE_CURRENT_BINARY_DIR}/PlasmaConfigVersion.cmake") + +configure_package_config_file( + "${CMAKE_CURRENT_SOURCE_DIR}/PlasmaConfig.cmake.in" + "${CMAKE_CURRENT_BINARY_DIR}/PlasmaConfig.cmake" + INSTALL_DESTINATION ${CMAKECONFIG_INSTALL_DIR} + PATH_VARS INCLUDE_INSTALL_DIR CMAKE_INSTALL_PREFIX +) + +install(FILES ${CMAKE_CURRENT_BINARY_DIR}/plasma_version.h + DESTINATION ${INCLUDE_INSTALL_DIR} COMPONENT Devel ) + +install(FILES + "${CMAKE_CURRENT_BINARY_DIR}/PlasmaConfig.cmake" + "${CMAKE_CURRENT_BINARY_DIR}/PlasmaConfigVersion.cmake" + DESTINATION "${CMAKECONFIG_INSTALL_DIR}" + COMPONENT Devel +) + + ################# list the subdirectories ################# -add_subdirectory(src) -add_subdirectory( desktoptheme ) +# add_subdirectory(src) +# add_subdirectory( desktoptheme ) feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES) diff --git a/PlasmaConfig.cmake.in b/PlasmaConfig.cmake.in new file mode 100644 index 000000000..d2cd498b2 --- /dev/null +++ b/PlasmaConfig.cmake.in @@ -0,0 +1,12 @@ +@PACKAGE_INIT@ + +# Any changes in this ".cmake" file will be overwritten by CMake, the source is the ".cmake.in" file. + +set(Plasma_INSTALL_PREFIX "@PACKAGE_CMAKE_INSTALL_PREFIX@") +set_and_check(Plasma_INCLUDE_DIR "@PACKAGE_INCLUDE_INSTALL_DIR@") + + +include("${CMAKE_CURRENT_LIST_DIR}/PlasmaTargets.cmake") + +set(KArchive_LIBRARIES KF5::KArchive) +set(KArchive_INCLUDE_DIRS ${KArchive_INCLUDE_DIR})