From 1a29ccaf9a2604ad405035a4a6f51413f74a1145 Mon Sep 17 00:00:00 2001 From: Brad King Date: Tue, 7 Dec 2010 16:28:56 -0500 Subject: 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. --- Source/cmCustomCommandGenerator.cxx | 8 +++++++- Source/cmLocalGenerator.cxx | 18 ------------------ Source/cmLocalGenerator.h | 5 ----- 3 files changed, 7 insertions(+), 24 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; } //---------------------------------------------------------------------------- diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx index b7d694c..d3cbc1f 100644 --- a/Source/cmLocalGenerator.cxx +++ b/Source/cmLocalGenerator.cxx @@ -1913,24 +1913,6 @@ bool cmLocalGenerator::GetRealDependency(const char* inName, } //---------------------------------------------------------------------------- -std::string cmLocalGenerator::GetRealLocation(const char* inName, - const char* config) -{ - std::string outName=inName; - // Look for a CMake target with the given name, which is an executable - // and which can be run - cmTarget* target = this->Makefile->FindTargetToUse(inName); - if ((target != 0) - && (target->GetType() == cmTarget::EXECUTABLE) - && ((this->Makefile->IsOn("CMAKE_CROSSCOMPILING") == false) - || (target->IsImported() == true))) - { - outName = target->GetLocation( config ); - } - return outName; -} - -//---------------------------------------------------------------------------- void cmLocalGenerator::AddSharedFlags(std::string& flags, const char* lang, bool shared) diff --git a/Source/cmLocalGenerator.h b/Source/cmLocalGenerator.h index 870ce36..35aab99 100644 --- a/Source/cmLocalGenerator.h +++ b/Source/cmLocalGenerator.h @@ -168,11 +168,6 @@ public: bool GetRealDependency(const char* name, const char* config, std::string& dep); - /** Translate a command as given in CMake code to the location of the - executable if the command is the name of a CMake executable target. - If that's not the case, just return the original name. */ - std::string GetRealLocation(const char* inName, const char* config); - ///! for existing files convert to output path and short path if spaces std::string ConvertToOutputForExisting(const char* remote, RelativeRoot local = START_OUTPUT); -- cgit v0.12