diff options
Diffstat (limited to 'Source/cmGetPropertyCommand.cxx')
-rw-r--r-- | Source/cmGetPropertyCommand.cxx | 27 |
1 files changed, 25 insertions, 2 deletions
diff --git a/Source/cmGetPropertyCommand.cxx b/Source/cmGetPropertyCommand.cxx index ba03568437..d2056d2964 100644 --- a/Source/cmGetPropertyCommand.cxx +++ b/Source/cmGetPropertyCommand.cxx @@ -2,13 +2,26 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmGetPropertyCommand.h" +#include <sstream> + #include "cmGlobalGenerator.h" +#include "cmInstalledFile.h" +#include "cmListFileCache.h" +#include "cmMakefile.h" +#include "cmPolicies.h" +#include "cmProperty.h" #include "cmPropertyDefinition.h" #include "cmSourceFile.h" #include "cmState.h" +#include "cmSystemTools.h" +#include "cmTarget.h" +#include "cmTargetPropertyComputer.h" #include "cmTest.h" #include "cmake.h" +class cmExecutionStatus; +class cmMessenger; + cmGetPropertyCommand::cmGetPropertyCommand() { this->InfoType = OutValue; @@ -246,8 +259,18 @@ bool cmGetPropertyCommand::HandleTargetMode() } return this->StoreResult(CM_NULLPTR); } - return this->StoreResult( - target->GetProperty(this->PropertyName, this->Makefile)); + const char* prop_cstr = CM_NULLPTR; + cmListFileBacktrace bt = this->Makefile->GetBacktrace(); + cmMessenger* messenger = this->Makefile->GetMessenger(); + if (cmTargetPropertyComputer::PassesWhitelist( + target->GetType(), this->PropertyName, messenger, bt)) { + prop_cstr = + target->GetComputedProperty(this->PropertyName, messenger, bt); + if (!prop_cstr) { + prop_cstr = target->GetProperty(this->PropertyName); + } + } + return this->StoreResult(prop_cstr); } std::ostringstream e; e << "could not find TARGET " << this->Name |