[plasma-framework] /: Make installPackage cmake macro useful for other package types

Sebastian Kügler sebas at kde.org
Thu Apr 25 00:13:10 UTC 2013


Git commit b679eb6dabea787f4e73097cb340c35b9862bfc2 by Sebastian Kügler.
Committed on 25/04/2013 at 02:08.
Pushed by sebas into branch 'master'.

Make installPackage cmake macro useful for other package types

Make it possible to install any type into any path prefix. We just add
an optional argument to also specify the type, so from now on installed
service files will not all be plasma-applet-<pluginname>.desktop, but
for example plasma-wallpaper-<pluginname>.desktop.

CCMAIL:plasma-devel at kde.org

M  +6    -2    CMakeLists.txt

http://commits.kde.org/plasma-framework/b679eb6dabea787f4e73097cb340c35b9862bfc2

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 671aedf..ca26a0f 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -146,12 +146,16 @@ configure_file(config-compiler.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-compil
 
 
 macro(installPackage dir component)
-   set(root ${ARGN})
+   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 Messages.sh EXCLUDE)
-   install(FILES ${dir}/metadata.desktop DESTINATION ${SERVICES_INSTALL_DIR} RENAME plasma-applet-${component}.desktop)
+   install(FILES ${dir}/metadata.desktop DESTINATION ${SERVICES_INSTALL_DIR} RENAME plasma-${type}-${component}.desktop)
 endmacro()
 
 ################# list the subdirectories #################



More information about the Plasma-devel mailing list