CMake: provide a convenient external name for modules

The target name for a module is annoyingly long and hard-to-read. Set a
parent-scope variable with a nicer name to the full target name.
This commit is contained in:
Adriaan de Groot 2024-02-18 23:30:50 +01:00
parent cefb437324
commit 87be4c4a81

View File

@ -67,7 +67,9 @@
# 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>", # The target defined this way is called "calamares_<TYPE>_<module-name>",
# e.g. "calamares_viewmodule_packagechooserq". # e.g. "calamares_viewmodule_packagechooserq". The function sets a variable
# in its **calling** scope, `<module-name>_TARGET` with the full name
# of the target.
include( CMakeParseArguments ) include( CMakeParseArguments )
@ -226,4 +228,6 @@ function( calamares_add_plugin )
message( "" ) message( "" )
endif() endif()
endif() endif()
set(${NAME}_TARGET ${target} PARENT_SCOPE)
endfunction() endfunction()