From 0d6cdae8f9869dbedc7396b5cfac39f43e76ca51 Mon Sep 17 00:00:00 2001 From: "Friedrich W. H. Kossebau" Date: Sat, 29 May 2021 01:24:27 +0200 Subject: kconfig_add_kcfg_files: catch alias targets before failing internally target_sources() as used internally does not take alias targets. --- KF5ConfigMacros.cmake | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'KF5ConfigMacros.cmake') diff --git a/KF5ConfigMacros.cmake b/KF5ConfigMacros.cmake index 7938e4cf..3ceaf17c 100644 --- a/KF5ConfigMacros.cmake +++ b/KF5ConfigMacros.cmake @@ -4,6 +4,7 @@ # Use optional GENERATE_MOC to generate moc if you use signals in your kcfg files. # Use optional USE_RELATIVE_PATH to generate the classes in the build following the given # relative path to the file. +# must not be an alias. # # SPDX-FileCopyrightText: 2006-2009 Alexander Neundorf # SPDX-FileCopyrightText: 2006, 2007, Laurent Montel @@ -17,6 +18,13 @@ function (KCONFIG_ADD_KCFG_FILES _target_or_source_var) set(options GENERATE_MOC USE_RELATIVE_PATH) cmake_parse_arguments(ARG "${options}" "" "" ${ARGN}) + if (TARGET ${_target_or_source_var}) + get_target_property(aliased_target ${_target_or_source_var} ALIASED_TARGET) + if(aliased_target) + message(FATAL_ERROR "Target argument passed to kconfig_add_kcfg_files must not be an alias: ${_target_or_source_var}") + endif() + endif() + set(sources) foreach (_current_FILE ${ARG_UNPARSED_ARGUMENTS}) get_filename_component(_tmp_FILE ${_current_FILE} ABSOLUTE) -- cgit v1.2.1