summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2024-02-01 13:32:11 (GMT)
committerKitware Robot <kwrobot@kitware.com>2024-02-01 13:32:20 (GMT)
commit58d424bca1d4e4cfc755e2fba95fdf55f6e9f215 (patch)
tree75d40faa60701761f0448ceee655241f90c0d738 /Source
parent3cabf45a99b8221d4402bf538d3e3b2d1869e003 (diff)
parent3b07ec631db67e2e44d9f39fb7727a2dafd07b6a (diff)
downloadCMake-58d424bca1d4e4cfc755e2fba95fdf55f6e9f215.zip
CMake-58d424bca1d4e4cfc755e2fba95fdf55f6e9f215.tar.gz
CMake-58d424bca1d4e4cfc755e2fba95fdf55f6e9f215.tar.bz2
Merge topic 'add_custom_command-target-alias'
3b07ec631d add_custom_command: Allow adding build event via ALIAS target Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !9201
Diffstat (limited to 'Source')
-rw-r--r--Source/cmMakefile.cxx10
1 files changed, 8 insertions, 2 deletions
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index 2687afa..509f28b 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -1144,9 +1144,15 @@ cmTarget* cmMakefile::GetCustomCommandTarget(
const std::string& target, cmObjectLibraryCommands objLibCommands,
const cmListFileBacktrace& lfbt) const
{
- // Find the target to which to add the custom command.
- auto ti = this->Targets.find(target);
+ auto realTarget = target;
+ auto ai = this->AliasTargets.find(target);
+ if (ai != this->AliasTargets.end()) {
+ realTarget = ai->second;
+ }
+
+ // Find the target to which to add the custom command.
+ auto ti = this->Targets.find(realTarget);
if (ti == this->Targets.end()) {
MessageType messageType = MessageType::AUTHOR_WARNING;
bool issueMessage = false;