summaryrefslogtreecommitdiffstats
path: root/Source/cmTarget.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2013-01-29 19:52:13 (GMT)
committerCMake Topic Stage <kwrobot@kitware.com>2013-01-29 19:52:13 (GMT)
commit3e7bba3fb2d431b512181e99c6333e9dfdc8a9fd (patch)
tree255649e6fb377ba37579f90d82a6532382befef2 /Source/cmTarget.cxx
parentc42deac744e1f5637ab592d696b3e8709da2a10c (diff)
parent429e369974015640d7a0878d986e3e418b42b7a4 (diff)
downloadCMake-3e7bba3fb2d431b512181e99c6333e9dfdc8a9fd.zip
CMake-3e7bba3fb2d431b512181e99c6333e9dfdc8a9fd.tar.gz
CMake-3e7bba3fb2d431b512181e99c6333e9dfdc8a9fd.tar.bz2
Merge topic 'fix-automoc-compile-defs'
429e369 Process COMPILE_DEFINITIONS as generator expressions in QtAutomoc. 0e10782 Move GetCompileDefinitions to cmTarget.
Diffstat (limited to 'Source/cmTarget.cxx')
-rw-r--r--Source/cmTarget.cxx29
1 files changed, 29 insertions, 0 deletions
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index e3be510..5669872 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -2815,6 +2815,35 @@ std::vector<std::string> cmTarget::GetIncludeDirectories(const char *config)
}
//----------------------------------------------------------------------------
+std::string cmTarget::GetCompileDefinitions(const char *config)
+{
+ std::string defPropName = "COMPILE_DEFINITIONS";
+ if (config)
+ {
+ defPropName += "_" + cmSystemTools::UpperCase(config);
+ }
+
+ const char *prop = this->GetProperty(defPropName.c_str());
+
+ if (!prop)
+ {
+ return "";
+ }
+
+ cmListFileBacktrace lfbt;
+ cmGeneratorExpression ge(lfbt);
+
+ cmGeneratorExpressionDAGChecker dagChecker(lfbt,
+ this->GetName(),
+ defPropName, 0, 0);
+ return ge.Parse(prop)->Evaluate(this->Makefile,
+ config,
+ false,
+ this,
+ &dagChecker);
+}
+
+//----------------------------------------------------------------------------
void cmTarget::MaybeInvalidatePropertyCache(const char* prop)
{
// Wipe out maps caching information affected by this property.