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@kde.org
This commit is contained in:
Sebastian Kügler 2013-04-25 02:08:47 +02:00
parent db5ef57480
commit b679eb6dab

View File

@ -146,12 +146,16 @@ configure_file(config-compiler.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-compil
macro(installPackage dir component) macro(installPackage dir component)
set(root ${ARGN}) set(root ${ARGV2})
set(type ${ARGV3})
if(NOT root) if(NOT root)
set(root plasma/plasmoids) set(root plasma/plasmoids)
endif() endif()
if(NOT type)
set(type applet)
endif()
install(DIRECTORY ${dir}/ DESTINATION ${DATA_INSTALL_DIR}/${root}/${component} PATTERN Messages.sh EXCLUDE) 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() endmacro()
################# list the subdirectories ################# ################# list the subdirectories #################