From 02aa49d4427eece0f8ef0537a17b4475d22b343b Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Sun, 31 Dec 2023 00:18:05 +0100 Subject: [PATCH] CMake: drop "view" alias for module type Allowing aliases and not using a canonical name for them (e.g. mapping "view" to "viewmodule") is annoying since the target name depends on which alias is passed in to the function. Drop one of the two aliases. --- CMakeModules/CalamaresAddPlugin.cmake | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/CMakeModules/CalamaresAddPlugin.cmake b/CMakeModules/CalamaresAddPlugin.cmake index 34ade2bd6..891050626 100644 --- a/CMakeModules/CalamaresAddPlugin.cmake +++ b/CMakeModules/CalamaresAddPlugin.cmake @@ -19,7 +19,7 @@ # # calamares_add_plugin( # module-name -# TYPE +# TYPE # EXPORT_MACRO macro-name # SOURCES source-file... # UI ui-file... @@ -35,7 +35,7 @@ # [WEIGHT w] # ) # -# Function parameters: +# Function optional parameters: # - COMPILE_DEFINITIONS # Definitions are set on the resulting module with a suitable # flag (i.e. `-D`) so only state the name (optionally, also the value) @@ -65,6 +65,9 @@ # SKIPPED_MODULES is set in the parent (i.e. caller's) scope with the # reason why. This should rarely be a concern as AddModuleSubdirectory # already handles skip-reasons and collects them for reporting. +# +# The target defined this way is called "calamares__", +# e.g. "calamares_viewmodule_packagechooserq". include( CMakeParseArguments ) @@ -126,7 +129,7 @@ function( calamares_add_plugin ) set( target "calamares_${PLUGIN_TYPE}_${PLUGIN_NAME}" ) # automatic library linkage - if(PLUGIN_TYPE STREQUAL "view" OR PLUGIN_TYPE STREQUAL "viewmodule") + if(PLUGIN_TYPE STREQUAL "viewmodule") list(APPEND PLUGIN_LINK_PRIVATE_LIBRARIES Calamares::calamaresui) elseif(PLUGIN_TYPE STREQUAL "job") list(APPEND PLUGIN_LINK_PRIVATE_LIBRARIES Calamares::calamares)