From b8e61d687abfacf1d5ed3b10cfe20315a344620c Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Fri, 21 Sep 2012 11:45:46 +0200 Subject: Refactor GetCompileDefinitions a bit. It is now easier to add generator expressions. --- Source/cmGeneratorTarget.cxx | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx index f8c274a..3f58433 100644 --- a/Source/cmGeneratorTarget.cxx +++ b/Source/cmGeneratorTarget.cxx @@ -316,13 +316,13 @@ std::vector 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 : ""; } -- cgit v0.12