diff options
author | Friedrich W. H. Kossebau <kossebau@kde.org> | 2021-05-29 01:24:27 +0200 |
---|---|---|
committer | Friedrich W. H. Kossebau <kossebau@kde.org> | 2021-05-29 01:24:27 +0200 |
commit | 0d6cdae8f9869dbedc7396b5cfac39f43e76ca51 (patch) | |
tree | e040f164cad1bb6a216df4465500881faeae1c31 | |
parent | e4a9b977d47cc1ec01282212039ed58241eafcf4 (diff) | |
download | kconfig-0d6cdae8f9869dbedc7396b5cfac39f43e76ca51.tar.gz kconfig-0d6cdae8f9869dbedc7396b5cfac39f43e76ca51.tar.bz2 |
kconfig_add_kcfg_files: catch alias targets before failing internally
target_sources() as used internally does not take alias targets.
-rw-r--r-- | KF5ConfigMacros.cmake | 8 |
1 files changed, 8 insertions, 0 deletions
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. +# <target> must not be an alias. # # SPDX-FileCopyrightText: 2006-2009 Alexander Neundorf <neundorf@kde.org> # SPDX-FileCopyrightText: 2006, 2007, Laurent Montel <montel@kde.org> @@ -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) |