From 22d261759b74a82a1946e09bc4ec6780c8f8e07a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20K=C3=BCgler?= Date: Thu, 13 Jun 2013 16:01:06 +0200 Subject: [PATCH] Fix up library finding * Generate and install and include PlasmaTargets.cmake file * set Plasma_LIBRARIES to KF5::plasma -> kde-workspace build works for me. --- CMakeLists.txt | 7 +++---- PlasmaConfig.cmake.in | 4 ++++ src/plasma/CMakeLists.txt | 2 ++ 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index ce13aea0e..d2b09e820 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -176,12 +176,11 @@ install(FILES COMPONENT Devel ) -# install(EXPORT plasmaTargets DESTINATION "${CMAKECONFIG_INSTALL_DIR}" -# FILE plasmaTargets.cmake COMPONENT Devel) - - ################# list the subdirectories ################# add_subdirectory(src) add_subdirectory( desktoptheme ) +# install(EXPORT plasmaTargets DESTINATION "${CMAKECONFIG_INSTALL_DIR}" +# FILE plasmaTargets.cmake COMPONENT Devel) +install(EXPORT PlasmaTargets DESTINATION "${CMAKECONFIG_INSTALL_DIR}" FILE PlasmaTargets.cmake NAMESPACE KF5:: COMPONENT Devel) feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES) diff --git a/PlasmaConfig.cmake.in b/PlasmaConfig.cmake.in index cb28a7464..06cecae06 100644 --- a/PlasmaConfig.cmake.in +++ b/PlasmaConfig.cmake.in @@ -2,7 +2,11 @@ # Any changes in this ".cmake" file will be overwritten by CMake, the source is the ".cmake.in" file. +include("${CMAKE_CURRENT_LIST_DIR}/PlasmaTargets.cmake") + set(Plasma_INSTALL_PREFIX "@PACKAGE_CMAKE_INSTALL_PREFIX@") set_and_check(Plasma_INCLUDE_DIR "@PACKAGE_INCLUDE_INSTALL_DIR@") +set(Plasma_LIBRARIES KF5::plasma) + include("${CMAKE_CURRENT_LIST_DIR}/PlasmaMacros.cmake") diff --git a/src/plasma/CMakeLists.txt b/src/plasma/CMakeLists.txt index 036e184ed..050325591 100644 --- a/src/plasma/CMakeLists.txt +++ b/src/plasma/CMakeLists.txt @@ -233,3 +233,5 @@ install(FILES data/operations/dataengineservice.operations DESTINATION ${DATA_IN install(FILES data/operations/plasmoidservice.operations DESTINATION ${DATA_INSTALL_DIR}/plasma/services) install(FILES data/operations/storage.operations DESTINATION ${DATA_INSTALL_DIR}/plasma/services) +install(TARGETS plasma EXPORT PlasmaTargets ${INSTALL_TARGETS_DEFAULT_ARGS}) +