diff options
author | Brad King <brad.king@kitware.com> | 2024-02-01 13:32:11 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2024-02-01 13:32:20 (GMT) |
commit | 58d424bca1d4e4cfc755e2fba95fdf55f6e9f215 (patch) | |
tree | 75d40faa60701761f0448ceee655241f90c0d738 /Source | |
parent | 3cabf45a99b8221d4402bf538d3e3b2d1869e003 (diff) | |
parent | 3b07ec631db67e2e44d9f39fb7727a2dafd07b6a (diff) | |
download | CMake-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.cxx | 10 |
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; |