From 87be4c4a81a6ed01b5464c87e1124fe07fe5d461 Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Sun, 18 Feb 2024 23:30:50 +0100 Subject: [PATCH] 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. --- CMakeModules/CalamaresAddPlugin.cmake | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/CMakeModules/CalamaresAddPlugin.cmake b/CMakeModules/CalamaresAddPlugin.cmake index 891050626..5143b966a 100644 --- a/CMakeModules/CalamaresAddPlugin.cmake +++ b/CMakeModules/CalamaresAddPlugin.cmake @@ -67,7 +67,9 @@ # already handles skip-reasons and collects them for reporting. # # The target defined this way is called "calamares__", -# e.g. "calamares_viewmodule_packagechooserq". +# e.g. "calamares_viewmodule_packagechooserq". The function sets a variable +# in its **calling** scope, `_TARGET` with the full name +# of the target. include( CMakeParseArguments ) @@ -226,4 +228,6 @@ function( calamares_add_plugin ) message( "" ) endif() endif() + + set(${NAME}_TARGET ${target} PARENT_SCOPE) endfunction()