diff options
author | Stephen Kelly <steveire@gmail.com> | 2012-09-21 11:45:46 +0200 |
---|---|---|
committer | Stephen Kelly <steveire@gmail.com> | 2012-09-21 13:31:12 +0200 |
commit | b8e61d687abfacf1d5ed3b10cfe20315a344620c (patch) | |
tree | db35b05f782c566193de5c248cde7ebef1c30e06 /Source/cmGeneratorTarget.cxx | |
parent | 2c2b25b203e653326c0f4064649da06a8cdfd7a5 (diff) | |
download | cmake-b8e61d687abfacf1d5ed3b10cfe20315a344620c.tar.gz |
Refactor GetCompileDefinitions a bit.
It is now easier to add generator expressions.
Diffstat (limited to 'Source/cmGeneratorTarget.cxx')
-rw-r--r-- | Source/cmGeneratorTarget.cxx | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx index f8c274a7db..3f58433328 100644 --- a/Source/cmGeneratorTarget.cxx +++ b/Source/cmGeneratorTarget.cxx @@ -316,13 +316,13 @@ std::vector<std::string> cmGeneratorTarget::GetIncludeDirectories() //---------------------------------------------------------------------------- std::string cmGeneratorTarget::GetCompileDefinitions(const char *config) { - if (!config) + std::string defPropName = "COMPILE_DEFINITIONS"; + if (config) { - return this->Target->GetProperty("COMPILE_DEFINITIONS"); + defPropName += "_" + cmSystemTools::UpperCase(config); } - std::string defPropName = "COMPILE_DEFINITIONS_"; - defPropName += - cmSystemTools::UpperCase(config); - return this->Target->GetProperty(defPropName.c_str()); + const char *prop = this->Target->GetProperty(defPropName.c_str()); + + return prop ? prop : ""; } |