plasma-framework/KF5PlasmaMacros.cmake

55 lines
2.1 KiB
CMake
Raw Normal View History

2013-10-31 09:30:24 +01:00
find_package(ECM 0.0.9 CONFIG REQUIRED)
include(KDEInstallDirs)
set(PLASMA_RELATIVE_DATA_INSTALL_DIR "plasma")
set(PLASMA_DATA_INSTALL_DIR "${DATA_INSTALL_DIR}/${PLASMA_RELATIVE_DATA_INSTALL_DIR}")
2013-08-13 01:15:36 +02:00
# plasma_install_package(path componentname [root] [type])
2013-08-13 01:15:36 +02:00
#
# Installs a Plasma package to the system path
# @arg path The source path to install from, location of metadata.desktop
# @arg componentname The plugin name of the component, corresponding to the
# X-KDE-PluginInfo-Name key in metadata.desktop
# @arg root The subdirectory to install to, default: plasmoids
# @arg type The type, default to applet, or applet, package, containment,
# wallpaper, shell, lookandfeel, etc.
# @see Types column in plasmapkg --list-types
#
# Examples:
# plasma_install_package(mywidget org.kde.plasma.mywidget) # installs an applet
# plasma_install_package(declarativetoolbox org.kde.toolbox packages package) # installs a generic package
2013-08-13 01:15:36 +02:00
#
macro(plasma_install_package dir component)
set(root ${ARGV2})
set(type ${ARGV3})
if(NOT root)
set(root plasmoids)
endif()
if(NOT type)
set(type applet)
endif()
install(DIRECTORY ${dir}/ DESTINATION ${PLASMA_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()
2013-08-13 01:15:36 +02:00
# plasma_add_plugin(pluginname sources_SRC)
#
# Use instead of add_library. Replacement for kde4_add_plugin
# Basically does add_library and removes the prefix of the library
#
# @arg pluginname The name of the plugin,
# @arg sources_SRC The source files to be built
#
# Example:
# plasma_add_plugin(plasma_engine_statusnotifieritem ${statusnotifieritem_engine_SRCS})
2013-08-13 01:15:36 +02:00
#
macro(plasma_add_plugin plugin)
2013-11-14 17:42:26 +01:00
message(WARNING "plasma_add_plugin() is deprecated, use add_library(MODULE) instead. You can use the porting scripts in plasma-framework/tools")
set(plugin_sources ${ARGN} )
add_library(${plugin} MODULE ${plugin_sources} )
set_target_properties(${plugin} PROPERTIES PREFIX "")
endmacro()