diff options
author | Brad King <brad.king@kitware.com> | 2010-12-21 19:03:24 (GMT) |
---|---|---|
committer | CMake Topic Stage <kwrobot@kitware.com> | 2010-12-21 19:03:24 (GMT) |
commit | 31b0657e7d4bab3e6c5a00c1318d1c231d8ab44b (patch) | |
tree | 5f16dfb9e9d73794a6c791147a6614b8e5492e2a /Source/cmTarget.cxx | |
parent | 533f5a20372829aa41a71ed4698cac2a50820a7e (diff) | |
parent | 4499d50ad2df7c1db4335d40f9fa20c642f59a5d (diff) | |
download | CMake-31b0657e7d4bab3e6c5a00c1318d1c231d8ab44b.zip CMake-31b0657e7d4bab3e6c5a00c1318d1c231d8ab44b.tar.gz CMake-31b0657e7d4bab3e6c5a00c1318d1c231d8ab44b.tar.bz2 |
Merge topic 'custom-command-generator-expressions'
4499d50 Mark CustomCommand test perconfig.out as SYMBOLIC
f0cdb60 Introduce "generator expression" syntax to custom commands (#11209)
4749e4c Record set of targets used in cmGeneratorExpression
ef9e9de Optionally suppress errors in cmGeneratorExpression
45e1953 Factor per-config sample targets out of 'Testing' test
4091bca Factor generator expression docs out of add_test
bfb7288 Record backtrace in cmCustomCommand
Diffstat (limited to 'Source/cmTarget.cxx')
-rw-r--r-- | Source/cmTarget.cxx | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx index ef274b4..9a698c0 100644 --- a/Source/cmTarget.cxx +++ b/Source/cmTarget.cxx @@ -17,6 +17,7 @@ #include "cmGlobalGenerator.h" #include "cmComputeLinkInformation.h" #include "cmListFileCache.h" +#include "cmGeneratorExpression.h" #include <cmsys/RegularExpression.hxx> #include <map> #include <set> @@ -1402,6 +1403,7 @@ cmTargetTraceDependencies { // Transform command names that reference targets built in this // project to corresponding target-level dependencies. + cmGeneratorExpression ge(this->Makefile, 0, cc.GetBacktrace(), true); for(cmCustomCommandLines::const_iterator cit = cc.GetCommandLines().begin(); cit != cc.GetCommandLines().end(); ++cit) { @@ -1418,6 +1420,21 @@ cmTargetTraceDependencies this->Target->AddUtility(command.c_str()); } } + + // Check for target references in generator expressions. + for(cmCustomCommandLine::const_iterator cli = cit->begin(); + cli != cit->end(); ++cli) + { + ge.Process(*cli); + } + } + + // Add target-level dependencies referenced by generator expressions. + std::set<cmTarget*> targets = ge.GetTargets(); + for(std::set<cmTarget*>::iterator ti = targets.begin(); + ti != targets.end(); ++ti) + { + this->Target->AddUtility((*ti)->GetName()); } // Queue the custom command dependencies. |