Try a bit saner setup of the cmake foo

- Installs PlasmaConfig, FindPlasma, PlasmaMacros, etc.
- find_package Plasma works
- version set to 2.0.0, do we dare that?

This might bump into FindPlasma.cmake, which is installed by kdelibs,
and should be removed: it applies to Plasma 4.1 only and bails out,
since after that, we used the KDE4 libs find_package foo. Now we're kind
of going back to pre-4.2 times. :-)
This commit is contained in:
Sebastian Kügler 2013-05-03 03:16:07 +02:00
parent 0677747fb2
commit fde2a1f709
4 changed files with 56 additions and 5 deletions

View File

@ -187,10 +187,17 @@ install(FILES
DESTINATION "${CMAKECONFIG_INSTALL_DIR}" DESTINATION "${CMAKECONFIG_INSTALL_DIR}"
COMPONENT Devel COMPONENT Devel
) )
install(FILES
"${CMAKE_CURRENT_SOURCE_DIR}/PlasmaMacros.cmake"
"FindPlasma.cmake"
DESTINATION
${DATA_INSTALL_DIR}/cmake/modules
)
################# list the subdirectories ################# ################# list the subdirectories #################
# add_subdirectory(src) add_subdirectory(src)
# add_subdirectory( desktoptheme ) add_subdirectory( desktoptheme )
feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES) feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES)

22
FindPlasma.cmake Normal file
View File

@ -0,0 +1,22 @@
# - Try to find konqueror library
# Once done this will define
#
# PLASMA_FOUND - system has libkonq library
# PLASMA_INCLUDE_DIR - the PLASMA include directory
# PLASMA_LIBRARY - the libkonq library
# Original file: FindMarbleWidget.cmake (found in digikam-0.10.0-beta2)
# copyright 2008 by Patrick Spendrin <ps_ml@gmx.de>
# Copyright (c) 2009, Alexander Neundorf, <neundorf@kde.org>
# use this file as you like
#
# Modifications to find libkonq by Joachim Eibl 2008
find_path(PLASMA_INCLUDE_DIR plasma/plasma_export.h )
find_library(PLASMA_LIBRARY plasma)
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(PLASMA DEFAULT_MSG PLASMA_INCLUDE_DIR PLASMA_LIBRARY )
mark_as_advanced(PLASMA_INCLUDE_DIR PLASMA_LIBRARY)

View File

@ -5,8 +5,12 @@
set(Plasma_INSTALL_PREFIX "@PACKAGE_CMAKE_INSTALL_PREFIX@") set(Plasma_INSTALL_PREFIX "@PACKAGE_CMAKE_INSTALL_PREFIX@")
set_and_check(Plasma_INCLUDE_DIR "@PACKAGE_INCLUDE_INSTALL_DIR@") set_and_check(Plasma_INCLUDE_DIR "@PACKAGE_INCLUDE_INSTALL_DIR@")
include("PlasmaMacros.cmake")
#include("${CMAKE_CURRENT_SOURCE_DIR}/PlasmaMacros.cmake")
include("${CMAKE_CURRENT_LIST_DIR}/PlasmaTargets.cmake") include("${CMAKE_CURRENT_LIST_DIR}/PlasmaTargets.cmake")
set(KArchive_LIBRARIES KF5::KArchive)
set(KArchive_INCLUDE_DIRS ${KArchive_INCLUDE_DIR}) macro(fsck)
message("FSCK!!!!")
endmacro()

18
PlasmaMacros.cmake Normal file
View File

@ -0,0 +1,18 @@
find_package(KF5 MODULE REQUIRED COMPONENTS InstallDirs)
macro(installPackage dir component)
set(root ${ARGV2})
set(type ${ARGV3})
if(NOT root)
set(root plasma/plasmoids)
endif()
if(NOT type)
set(type applet)
endif()
install(DIRECTORY ${dir}/ DESTINATION ${DATA_INSTALL_DIR}/${root}/${component} PATTERN .svn EXCLUDE PATTERN CMakeLists.txt EXCLUDE PATTERN Messages.sh EXCLUDE)
install(FILES ${dir}/metadata.desktop DESTINATION ${SERVICES_INSTALL_DIR} RENAME plasma-${type}-${component}.desktop)
endmacro()