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.
This commit is contained in:
Adriaan de Groot 2023-12-31 00:18:05 +01:00
parent f847f90842
commit 02aa49d442

View File

@ -19,7 +19,7 @@
# #
# calamares_add_plugin( # calamares_add_plugin(
# module-name # module-name
# TYPE <view|job> # TYPE <viewmodule|job>
# EXPORT_MACRO macro-name # EXPORT_MACRO macro-name
# SOURCES source-file... # SOURCES source-file...
# UI ui-file... # UI ui-file...
@ -35,7 +35,7 @@
# [WEIGHT w] # [WEIGHT w]
# ) # )
# #
# Function parameters: # Function optional parameters:
# - COMPILE_DEFINITIONS # - COMPILE_DEFINITIONS
# Definitions are set on the resulting module with a suitable # Definitions are set on the resulting module with a suitable
# flag (i.e. `-D`) so only state the name (optionally, also the value) # 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 # SKIPPED_MODULES is set in the parent (i.e. caller's) scope with the
# reason why. This should rarely be a concern as AddModuleSubdirectory # reason why. This should rarely be a concern as AddModuleSubdirectory
# already handles skip-reasons and collects them for reporting. # already handles skip-reasons and collects them for reporting.
#
# The target defined this way is called "calamares_<TYPE>_<module-name>",
# e.g. "calamares_viewmodule_packagechooserq".
include( CMakeParseArguments ) include( CMakeParseArguments )
@ -126,7 +129,7 @@ function( calamares_add_plugin )
set( target "calamares_${PLUGIN_TYPE}_${PLUGIN_NAME}" ) set( target "calamares_${PLUGIN_TYPE}_${PLUGIN_NAME}" )
# automatic library linkage # 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) list(APPEND PLUGIN_LINK_PRIVATE_LIBRARIES Calamares::calamaresui)
elseif(PLUGIN_TYPE STREQUAL "job") elseif(PLUGIN_TYPE STREQUAL "job")
list(APPEND PLUGIN_LINK_PRIVATE_LIBRARIES Calamares::calamares) list(APPEND PLUGIN_LINK_PRIVATE_LIBRARIES Calamares::calamares)