summaryrefslogtreecommitdiffstats
path: root/Source/cmCustomCommandGenerator.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2010-12-07 21:28:56 (GMT)
committerBrad King <brad.king@kitware.com>2010-12-08 22:29:53 (GMT)
commit1a29ccaf9a2604ad405035a4a6f51413f74a1145 (patch)
tree1214f90af26e5948376c092a81810e6dd65b55b2 /Source/cmCustomCommandGenerator.cxx
parent542b517449e8c7101ac6fbd316749bd461b48588 (diff)
downloadCMake-1a29ccaf9a2604ad405035a4a6f51413f74a1145.zip
CMake-1a29ccaf9a2604ad405035a4a6f51413f74a1145.tar.gz
CMake-1a29ccaf9a2604ad405035a4a6f51413f74a1145.tar.bz2
Remove cmLocalGenerator::GetRealLocation
The cmCustomCommandGenerator::GetCommand method completely replaces the purpose of this method. Re-implement GetRealLocation inline at the only remaining call site and remove it.
Diffstat (limited to 'Source/cmCustomCommandGenerator.cxx')
-rw-r--r--Source/cmCustomCommandGenerator.cxx8
1 files changed, 7 insertions, 1 deletions
diff --git a/Source/cmCustomCommandGenerator.cxx b/Source/cmCustomCommandGenerator.cxx
index 890ac9c..2a3b553 100644
--- a/Source/cmCustomCommandGenerator.cxx
+++ b/Source/cmCustomCommandGenerator.cxx
@@ -33,7 +33,13 @@ unsigned int cmCustomCommandGenerator::GetNumberOfCommands() const
std::string cmCustomCommandGenerator::GetCommand(unsigned int c) const
{
std::string const& argv0 = this->CC.GetCommandLines()[c][0];
- return this->LG->GetRealLocation(argv0.c_str(), this->Config);
+ cmTarget* target = this->Makefile->FindTargetToUse(argv0.c_str());
+ if(target && target->GetType() == cmTarget::EXECUTABLE &&
+ (target->IsImported() || !this->Makefile->IsOn("CMAKE_CROSSCOMPILING")))
+ {
+ return target->GetLocation(this->Config);
+ }
+ return argv0;
}
//----------------------------------------------------------------------------