Changeset View
Changeset View
Standalone View
Standalone View
KF5CoreAddonsMacros.cmake
Show First 20 Lines • Show All 97 Lines • ▼ Show 20 Line(s) | |||||
98 | # | 98 | # | ||
99 | # kcoreaddons_add_plugin(plugin_name SOURCES... [JSON "pluginname.json"] [INSTALL_NAMESPACE "servicename"]) | 99 | # kcoreaddons_add_plugin(plugin_name SOURCES... [JSON "pluginname.json"] [INSTALL_NAMESPACE "servicename"]) | ||
100 | # | 100 | # | ||
101 | # This macro helps simplifying the creation of plugins for KPluginFactory | 101 | # This macro helps simplifying the creation of plugins for KPluginFactory | ||
102 | # based systems. | 102 | # based systems. | ||
103 | # It will create a plugin given the SOURCES list, the name of the JSON file | 103 | # It will create a plugin given the SOURCES list, the name of the JSON file | ||
104 | # that will define the plugin's metadata and the INSTALL_NAMESPACE so that | 104 | # that will define the plugin's metadata and the INSTALL_NAMESPACE so that | ||
105 | # the plugin is installed with the rest of the plugins from the same sub-system, | 105 | # the plugin is installed with the rest of the plugins from the same sub-system, | ||
106 | # within ${PLUGIN_INSTALL_DIR}. | 106 | # within ${KDE_INSTALL_PLUGINDIR}. | ||
107 | # | 107 | # | ||
108 | # Example: | 108 | # Example: | ||
109 | # kcoreaddons_add_plugin(kdeconnect_share JSON kdeconnect_share.json SOURCES ${kdeconnect_share_SRCS}) | 109 | # kcoreaddons_add_plugin(kdeconnect_share JSON kdeconnect_share.json SOURCES ${kdeconnect_share_SRCS}) | ||
110 | # | 110 | # | ||
111 | # Since 5.10.0 | 111 | # Since 5.10.0 | ||
112 | 112 | | |||
113 | function(kcoreaddons_add_plugin plugin) | 113 | function(kcoreaddons_add_plugin plugin) | ||
114 | set(options) | 114 | set(options) | ||
Show All 12 Lines | |||||
127 | # See https://community.kde.org/Guidelines_and_HOWTOs/Making_apps_run_uninstalled | 127 | # See https://community.kde.org/Guidelines_and_HOWTOs/Making_apps_run_uninstalled | ||
128 | if(NOT ("${ECM_GLOBAL_FIND_VERSION}" VERSION_LESS "5.38.0")) | 128 | if(NOT ("${ECM_GLOBAL_FIND_VERSION}" VERSION_LESS "5.38.0")) | ||
129 | set_target_properties(${plugin} PROPERTIES LIBRARY_OUTPUT_DIRECTORY "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${KCA_ADD_PLUGIN_INSTALL_NAMESPACE}") | 129 | set_target_properties(${plugin} PROPERTIES LIBRARY_OUTPUT_DIRECTORY "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${KCA_ADD_PLUGIN_INSTALL_NAMESPACE}") | ||
130 | endif() | 130 | endif() | ||
131 | 131 | | |||
132 | if (NOT KCA_ADD_PLUGIN_INSTALL_NAMESPACE) | 132 | if (NOT KCA_ADD_PLUGIN_INSTALL_NAMESPACE) | ||
133 | message(FATAL_ERROR "Must specify INSTALL_NAMESPACE for ${plugin}") | 133 | message(FATAL_ERROR "Must specify INSTALL_NAMESPACE for ${plugin}") | ||
134 | endif() | 134 | endif() | ||
135 | install(TARGETS ${plugin} DESTINATION ${PLUGIN_INSTALL_DIR}/${KCA_ADD_PLUGIN_INSTALL_NAMESPACE}) | 135 | install(TARGETS ${plugin} DESTINATION ${KDE_INSTALL_PLUGINDIR}/${KCA_ADD_PLUGIN_INSTALL_NAMESPACE}) | ||
136 | endfunction() | 136 | endfunction() |