diff options
Diffstat (limited to 'Source')
-rw-r--r-- | Source/cmGetPropertyCommand.cxx | 3 | ||||
-rw-r--r-- | Source/cmGetTargetPropertyCommand.cxx | 2 | ||||
-rw-r--r-- | Source/cmTarget.cxx | 21 | ||||
-rw-r--r-- | Source/cmTarget.h | 3 |
4 files changed, 19 insertions, 10 deletions
diff --git a/Source/cmGetPropertyCommand.cxx b/Source/cmGetPropertyCommand.cxx index 33c43ca..810802a 100644 --- a/Source/cmGetPropertyCommand.cxx +++ b/Source/cmGetPropertyCommand.cxx @@ -302,7 +302,8 @@ bool cmGetPropertyCommand::HandleTargetMode() } if(cmTarget* target = this->Makefile->FindTargetToUse(this->Name)) { - return this->StoreResult(target->GetProperty(this->PropertyName.c_str())); + return this->StoreResult(target->GetProperty(this->PropertyName.c_str(), + this->Makefile)); } else { diff --git a/Source/cmGetTargetPropertyCommand.cxx b/Source/cmGetTargetPropertyCommand.cxx index 4aa49fe..272607e 100644 --- a/Source/cmGetTargetPropertyCommand.cxx +++ b/Source/cmGetTargetPropertyCommand.cxx @@ -38,7 +38,7 @@ bool cmGetTargetPropertyCommand else if(cmTarget* tgt = this->Makefile->FindTargetToUse(targetName)) { cmTarget& target = *tgt; - prop = target.GetProperty(args[2].c_str()); + prop = target.GetProperty(args[2].c_str(), this->Makefile); } else { diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx index 9eb1f63..219560e 100644 --- a/Source/cmTarget.cxx +++ b/Source/cmTarget.cxx @@ -2624,7 +2624,7 @@ const char* cmTarget::GetFeature(const char* feature, const char* config) const } //---------------------------------------------------------------------------- -bool cmTarget::HandleLocationPropertyPolicy() const +bool cmTarget::HandleLocationPropertyPolicy(cmMakefile* context) const { if (this->IsImported()) { @@ -2633,7 +2633,7 @@ bool cmTarget::HandleLocationPropertyPolicy() const cmOStringStream e; const char *modal = 0; cmake::MessageType messageType = cmake::AUTHOR_WARNING; - switch (this->Makefile->GetPolicyStatus(cmPolicies::CMP0026)) + switch (context->GetPolicyStatus(cmPolicies::CMP0026)) { case cmPolicies::WARN: e << (this->Makefile->GetPolicies() @@ -2654,7 +2654,7 @@ bool cmTarget::HandleLocationPropertyPolicy() const << this->GetName() << "\". Use the target name directly with " "add_custom_command, or use the generator expression $<TARGET_FILE>, " "as appropriate.\n"; - this->Makefile->IssueMessage(messageType, e.str().c_str()); + context->IssueMessage(messageType, e.str().c_str()); } return messageType != cmake::FATAL_ERROR; @@ -2663,6 +2663,13 @@ bool cmTarget::HandleLocationPropertyPolicy() const //---------------------------------------------------------------------------- const char *cmTarget::GetProperty(const char* prop) const { + return this->GetProperty(prop, this->Makefile); +} + +//---------------------------------------------------------------------------- +const char *cmTarget::GetProperty(const char* prop, + cmMakefile* context) const +{ if(!prop) { return 0; @@ -2674,7 +2681,7 @@ const char *cmTarget::GetProperty(const char* prop) const cmOStringStream e; e << "INTERFACE_LIBRARY targets may only have whitelisted properties. " "The property \"" << prop << "\" is not allowed."; - this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str().c_str()); + context->IssueMessage(cmake::FATAL_ERROR, e.str().c_str()); return 0; } @@ -2693,7 +2700,7 @@ const char *cmTarget::GetProperty(const char* prop) const { if(strcmp(prop,"LOCATION") == 0) { - if (!this->HandleLocationPropertyPolicy()) + if (!this->HandleLocationPropertyPolicy(context)) { return 0; } @@ -2714,7 +2721,7 @@ const char *cmTarget::GetProperty(const char* prop) const // Support "LOCATION_<CONFIG>". if(cmHasLiteralPrefix(prop, "LOCATION_")) { - if (!this->HandleLocationPropertyPolicy()) + if (!this->HandleLocationPropertyPolicy(context)) { return 0; } @@ -2729,7 +2736,7 @@ const char *cmTarget::GetProperty(const char* prop) const std::string configName(prop, strlen(prop) - 9); if(configName != "IMPORTED") { - if (!this->HandleLocationPropertyPolicy()) + if (!this->HandleLocationPropertyPolicy(context)) { return 0; } diff --git a/Source/cmTarget.h b/Source/cmTarget.h index a23c601..a305caa 100644 --- a/Source/cmTarget.h +++ b/Source/cmTarget.h @@ -257,6 +257,7 @@ public: void SetProperty(const char *prop, const char *value); void AppendProperty(const char* prop, const char* value,bool asString=false); const char *GetProperty(const char *prop) const; + const char *GetProperty(const char *prop, cmMakefile* context) const; bool GetPropertyAsBool(const char *prop) const; void CheckProperty(const char* prop, cmMakefile* context) const; @@ -579,7 +580,7 @@ public: const std::string &compatibilityType) const; private: - bool HandleLocationPropertyPolicy() const; + bool HandleLocationPropertyPolicy(cmMakefile* context) const; // The set of include directories that are marked as system include // directories. |