diff options
-rw-r--r-- | Source/cmCustomCommandGenerator.cxx | 2 | ||||
-rw-r--r-- | Source/cmExtraCodeBlocksGenerator.cxx | 2 | ||||
-rw-r--r-- | Source/cmGeneratorTarget.cxx | 25 | ||||
-rw-r--r-- | Source/cmGeneratorTarget.h | 3 | ||||
-rw-r--r-- | Source/cmGlobalKdevelopGenerator.cxx | 2 | ||||
-rw-r--r-- | Source/cmLocalGenerator.cxx | 4 | ||||
-rw-r--r-- | Source/cmTarget.cxx | 15 | ||||
-rw-r--r-- | Source/cmTarget.h | 3 |
8 files changed, 31 insertions, 25 deletions
diff --git a/Source/cmCustomCommandGenerator.cxx b/Source/cmCustomCommandGenerator.cxx index 086c9f9588..7f3b651090 100644 --- a/Source/cmCustomCommandGenerator.cxx +++ b/Source/cmCustomCommandGenerator.cxx @@ -48,7 +48,7 @@ std::string cmCustomCommandGenerator::GetCommand(unsigned int c) const (target->Target->IsImported() || !this->LG->GetMakefile()->IsOn("CMAKE_CROSSCOMPILING"))) { - return target->Target->GetLocation(this->Config); + return target->GetLocation(this->Config); } return this->GE->Parse(argv0)->Evaluate(this->LG->GetMakefile(), this->Config); diff --git a/Source/cmExtraCodeBlocksGenerator.cxx b/Source/cmExtraCodeBlocksGenerator.cxx index 6d145a2121..933a256aff 100644 --- a/Source/cmExtraCodeBlocksGenerator.cxx +++ b/Source/cmExtraCodeBlocksGenerator.cxx @@ -593,7 +593,7 @@ void cmExtraCodeBlocksGenerator::AppendTarget(cmGeneratedFileStream& fout, { cmGeneratorTarget* gt = this->GlobalGenerator->GetGeneratorTarget(target); - location = gt->Target->GetLocation(buildType); + location = gt->GetLocation(buildType); } fout<<" <Option output=\"" << location diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx index dc5a2a15af..9fe79223ca 100644 --- a/Source/cmGeneratorTarget.cxx +++ b/Source/cmGeneratorTarget.cxx @@ -520,6 +520,26 @@ void cmGeneratorTarget } //---------------------------------------------------------------------------- +const char* cmGeneratorTarget::GetLocation(const std::string& config) const +{ + static std::string location; + if (this->Target->IsImported()) + { + location = this->Target->ImportedGetFullPath(config, false); + } + else + { + location = this->Target->GetFullPath(config, false); + } + return location.c_str(); +} + +bool cmGeneratorTarget::IsImported() const +{ + return this->Target->IsImported(); +} + +//---------------------------------------------------------------------------- bool cmGeneratorTarget::IsSystemIncludeDirectory(const std::string& dir, const std::string& config) const { @@ -834,7 +854,8 @@ bool cmTargetTraceDependencies::IsUtility(std::string const& dep) } // Check for a target with this name. - if(cmTarget* t = this->Makefile->FindTargetToUse(util)) + if(cmGeneratorTarget* t + = this->Makefile->FindGeneratorTargetToUse(util)) { // If we find the target and the dep was given as a full path, // then make sure it was not a full path to something else, and @@ -846,7 +867,7 @@ bool cmTargetTraceDependencies::IsUtility(std::string const& dep) { // This is really only for compatibility so we do not need to // worry about configuration names and output names. - std::string tLocation = t->GetLocationForBuild(); + std::string tLocation = t->Target->GetLocationForBuild(); tLocation = cmSystemTools::GetFilenamePath(tLocation); std::string depLocation = cmSystemTools::GetFilenamePath(dep); depLocation = cmSystemTools::CollapseFullPath(depLocation); diff --git a/Source/cmGeneratorTarget.h b/Source/cmGeneratorTarget.h index 675ee9ffad..060007f593 100644 --- a/Source/cmGeneratorTarget.h +++ b/Source/cmGeneratorTarget.h @@ -28,6 +28,9 @@ public: cmLocalGenerator* GetLocalGenerator() const; + bool IsImported() const; + const char *GetLocation(const std::string& config) const; + int GetType() const; std::string GetName() const; const char *GetProperty(const std::string& prop) const; diff --git a/Source/cmGlobalKdevelopGenerator.cxx b/Source/cmGlobalKdevelopGenerator.cxx index 6611c749f7..138ddbbbc4 100644 --- a/Source/cmGlobalKdevelopGenerator.cxx +++ b/Source/cmGlobalKdevelopGenerator.cxx @@ -76,7 +76,7 @@ void cmGlobalKdevelopGenerator::Generate() { if (ti->second->GetType()==cmTarget::EXECUTABLE) { - executable = ti->second->Target->GetLocation(""); + executable = ti->second->GetLocation(""); break; } } diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx index d6c8baeb8b..2e20ee28c1 100644 --- a/Source/cmLocalGenerator.cxx +++ b/Source/cmLocalGenerator.cxx @@ -1710,7 +1710,7 @@ bool cmLocalGenerator::GetRealDependency(const std::string& inName, if(target->GetType() >= cmTarget::EXECUTABLE && target->GetType() <= cmTarget::MODULE_LIBRARY) { - tLocation = target->Target->GetLocation(config); + tLocation = target->GetLocation(config); tLocation = cmSystemTools::GetFilenamePath(tLocation); tLocation = cmSystemTools::CollapseFullPath(tLocation); } @@ -1733,7 +1733,7 @@ bool cmLocalGenerator::GetRealDependency(const std::string& inName, case cmTarget::SHARED_LIBRARY: case cmTarget::MODULE_LIBRARY: case cmTarget::UNKNOWN_LIBRARY: - dep = target->Target->GetLocation(config); + dep = target->GetLocation(config); return true; case cmTarget::OBJECT_LIBRARY: // An object library has no single file on which to depend. diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx index e4cd4f342c..9122daf624 100644 --- a/Source/cmTarget.cxx +++ b/Source/cmTarget.cxx @@ -2739,21 +2739,6 @@ std::string cmTarget::GetCompilePDBDirectory(const std::string& config) const } //---------------------------------------------------------------------------- -const char* cmTarget::GetLocation(const std::string& config) const -{ - static std::string location; - if (this->IsImported()) - { - location = this->ImportedGetFullPath(config, false); - } - else - { - location = this->GetFullPath(config, false); - } - return location.c_str(); -} - -//---------------------------------------------------------------------------- const char* cmTarget::ImportedGetLocation(const std::string& config) const { static std::string location; diff --git a/Source/cmTarget.h b/Source/cmTarget.h index a0198e2e4e..4d419eef01 100644 --- a/Source/cmTarget.h +++ b/Source/cmTarget.h @@ -374,9 +374,6 @@ public: compiler pdb output directory is given. */ std::string GetCompilePDBDirectory(const std::string& config = "") const; - /** Get the location of the target in the build tree for the given - configuration. */ - const char* GetLocation(const std::string& config) const; const char* ImportedGetLocation(const std::string& config) const; /** Get the location of the target in the build tree with a placeholder |