summaryrefslogtreecommitdiff
path: root/Source/cmGeneratorTarget.cxx
diff options
context:
space:
mode:
authorStephen Kelly <steveire@gmail.com>2012-09-21 11:45:46 +0200
committerStephen Kelly <steveire@gmail.com>2012-09-21 13:31:12 +0200
commitb8e61d687abfacf1d5ed3b10cfe20315a344620c (patch)
treedb35b05f782c566193de5c248cde7ebef1c30e06 /Source/cmGeneratorTarget.cxx
parent2c2b25b203e653326c0f4064649da06a8cdfd7a5 (diff)
downloadcmake-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.cxx12
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 : "";
}