diff options
-rw-r--r-- | Source/cmGeneratorTarget.cxx | 10 | ||||
-rw-r--r-- | Source/cmGeneratorTarget.h | 2 | ||||
-rw-r--r-- | Source/cmQtAutoGeneratorInitializer.cxx | 21 | ||||
-rw-r--r-- | Source/cmTarget.cxx | 9 | ||||
-rw-r--r-- | Source/cmTarget.h | 2 |
5 files changed, 27 insertions, 17 deletions
diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx index 98150df..2ef2f5c 100644 --- a/Source/cmGeneratorTarget.cxx +++ b/Source/cmGeneratorTarget.cxx @@ -3344,6 +3344,16 @@ std::string cmGeneratorTarget::GetFullNameInternal(const std::string& config, } //---------------------------------------------------------------------------- +const char* +cmGeneratorTarget::ImportedGetLocation(const std::string& config) const +{ + static std::string location; + assert(this->IsImported()); + location = this->Target->ImportedGetFullPath(config, false); + return location.c_str(); +} + +//---------------------------------------------------------------------------- std::string cmGeneratorTarget::GetFullNameImported(const std::string& config, bool implib) const { diff --git a/Source/cmGeneratorTarget.h b/Source/cmGeneratorTarget.h index cf8c18f..e48e36e 100644 --- a/Source/cmGeneratorTarget.h +++ b/Source/cmGeneratorTarget.h @@ -443,6 +443,8 @@ public: no soname at all. */ bool IsImportedSharedLibWithoutSOName(const std::string& config) const; + const char* ImportedGetLocation(const std::string& config) const; + private: friend class cmTargetTraceDependencies; struct SourceEntry { std::vector<cmSourceFile*> Depends; }; diff --git a/Source/cmQtAutoGeneratorInitializer.cxx b/Source/cmQtAutoGeneratorInitializer.cxx index f9875b3..41172f6 100644 --- a/Source/cmQtAutoGeneratorInitializer.cxx +++ b/Source/cmQtAutoGeneratorInitializer.cxx @@ -132,6 +132,7 @@ static void SetupAutoMocTarget(cmGeneratorTarget const* target, std::map<std::string, std::string> &configIncludes, std::map<std::string, std::string> &configDefines) { + cmLocalGenerator* lg = target->GetLocalGenerator(); cmMakefile* makefile = target->Target->GetMakefile(); const char* tmp = target->GetProperty("AUTOMOC_MOC_OPTIONS"); @@ -188,7 +189,8 @@ static void SetupAutoMocTarget(cmGeneratorTarget const* target, const char *qtVersion = makefile->GetDefinition("_target_qt_version"); if (strcmp(qtVersion, "5") == 0) { - cmTarget *qt5Moc = makefile->FindTargetToUse("Qt5::moc"); + cmGeneratorTarget *qt5Moc = + lg->FindGeneratorTargetToUse("Qt5::moc"); if (!qt5Moc) { cmSystemTools::Error("Qt5::moc target not found ", @@ -200,7 +202,8 @@ static void SetupAutoMocTarget(cmGeneratorTarget const* target, } else if (strcmp(qtVersion, "4") == 0) { - cmTarget *qt4Moc = makefile->FindTargetToUse("Qt4::moc"); + cmGeneratorTarget *qt4Moc = + lg->FindGeneratorTargetToUse("Qt4::moc"); if (!qt4Moc) { cmSystemTools::Error("Qt4::moc target not found ", @@ -230,6 +233,7 @@ static void SetupAutoUicTarget(cmGeneratorTarget const* target, std::vector<std::string> const& skipUic, std::map<std::string, std::string> &configUicOptions) { + cmLocalGenerator* lg = target->GetLocalGenerator(); cmMakefile *makefile = target->Target->GetMakefile(); std::set<std::string> skipped; @@ -303,7 +307,8 @@ static void SetupAutoUicTarget(cmGeneratorTarget const* target, std::string targetName = target->GetName(); if (strcmp(qtVersion, "5") == 0) { - cmTarget *qt5Uic = makefile->FindTargetToUse("Qt5::uic"); + cmGeneratorTarget *qt5Uic = + lg->FindGeneratorTargetToUse("Qt5::uic"); if (!qt5Uic) { // Project does not use Qt5Widgets, but has AUTOUIC ON anyway @@ -316,7 +321,8 @@ static void SetupAutoUicTarget(cmGeneratorTarget const* target, } else if (strcmp(qtVersion, "4") == 0) { - cmTarget *qt4Uic = makefile->FindTargetToUse("Qt4::uic"); + cmGeneratorTarget *qt4Uic = + lg->FindGeneratorTargetToUse("Qt4::uic"); if (!qt4Uic) { cmSystemTools::Error("Qt4::uic target not found ", @@ -335,6 +341,7 @@ static void SetupAutoUicTarget(cmGeneratorTarget const* target, static std::string GetRccExecutable(cmGeneratorTarget const* target) { + cmLocalGenerator* lg = target->GetLocalGenerator(); cmMakefile *makefile = target->Target->GetMakefile(); const char *qtVersion = makefile->GetDefinition("_target_qt_version"); if (!qtVersion) @@ -355,7 +362,8 @@ static std::string GetRccExecutable(cmGeneratorTarget const* target) std::string targetName = target->GetName(); if (strcmp(qtVersion, "5") == 0) { - cmTarget *qt5Rcc = makefile->FindTargetToUse("Qt5::rcc"); + cmGeneratorTarget *qt5Rcc = + lg->FindGeneratorTargetToUse("Qt5::rcc"); if (!qt5Rcc) { cmSystemTools::Error("Qt5::rcc target not found ", @@ -366,7 +374,8 @@ static std::string GetRccExecutable(cmGeneratorTarget const* target) } else if (strcmp(qtVersion, "4") == 0) { - cmTarget *qt4Rcc = makefile->FindTargetToUse("Qt4::rcc"); + cmGeneratorTarget *qt4Rcc = + lg->FindGeneratorTargetToUse("Qt4::rcc"); if (!qt4Rcc) { cmSystemTools::Error("Qt4::rcc target not found ", diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx index bd01140..60c5e64 100644 --- a/Source/cmTarget.cxx +++ b/Source/cmTarget.cxx @@ -1628,15 +1628,6 @@ bool cmTarget::HaveWellDefinedOutputFiles() const } //---------------------------------------------------------------------------- -const char* cmTarget::ImportedGetLocation(const std::string& config) const -{ - static std::string location; - assert(this->IsImported()); - location = this->ImportedGetFullPath(config, false); - return location.c_str(); -} - -//---------------------------------------------------------------------------- void cmTarget::GetTargetVersion(int& major, int& minor) const { int patch; diff --git a/Source/cmTarget.h b/Source/cmTarget.h index a2846df..7715c7c 100644 --- a/Source/cmTarget.h +++ b/Source/cmTarget.h @@ -217,8 +217,6 @@ public: the link dependencies of this target. */ std::string CheckCMP0004(std::string const& item) const; - const char* ImportedGetLocation(const std::string& config) const; - /** Get the target major and minor version numbers interpreted from the VERSION property. Version 0 is returned if the property is not set or cannot be parsed. */ |