summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2008-01-15 15:49:59 (GMT)
committerBrad King <brad.king@kitware.com>2008-01-15 15:49:59 (GMT)
commit34c04d6d02acab067353e28155b546ad32617b55 (patch)
treef97d61505362cee771ba032f783982b55e5f9c31
parentda335fbd00462b3e6dbaece2ca34328262ed7614 (diff)
downloadCMake-34c04d6d02acab067353e28155b546ad32617b55.zip
CMake-34c04d6d02acab067353e28155b546ad32617b55.tar.gz
CMake-34c04d6d02acab067353e28155b546ad32617b55.tar.bz2
ENH: Added partial implementation of recognizing per-configration properties.
-rw-r--r--Source/cmake.cxx24
1 files changed, 23 insertions, 1 deletions
diff --git a/Source/cmake.cxx b/Source/cmake.cxx
index 31b80c7..c5466a6 100644
--- a/Source/cmake.cxx
+++ b/Source/cmake.cxx
@@ -3324,6 +3324,15 @@ void cmake::ReportUndefinedPropertyAccesses(const char *filename)
std::vector<std::string> enLangs;
this->GlobalGenerator->GetEnabledLanguages(enLangs);
+ // Common configuration names.
+ // TODO: Compute current configuration(s).
+ std::vector<std::string> enConfigs;
+ enConfigs.push_back("");
+ enConfigs.push_back("DEBUG");
+ enConfigs.push_back("RELEASE");
+ enConfigs.push_back("MINSIZEREL");
+ enConfigs.push_back("RELWITHDEBINFO");
+
// take all the defined properties and add definitions for all the enabled
// languages
std::set<std::pair<cmStdString,cmProperty::ScopeType> > aliasedProperties;
@@ -3334,7 +3343,20 @@ void cmake::ReportUndefinedPropertyAccesses(const char *filename)
cmPropertyDefinitionMap::iterator j;
for (j = i->second.begin(); j != i->second.end(); ++j)
{
- if (j->first.find("<LANG>"))
+ // TODO: What if both <LANG> and <CONFIG> appear?
+ if (j->first.find("<CONFIG>") != std::string::npos)
+ {
+ std::vector<std::string>::const_iterator k;
+ for (k = enConfigs.begin(); k != enConfigs.end(); ++k)
+ {
+ std::string tmp = j->first;
+ cmSystemTools::ReplaceString(tmp, "<CONFIG>", k->c_str());
+ // add alias
+ aliasedProperties.insert
+ (std::pair<cmStdString,cmProperty::ScopeType>(tmp,i->first));
+ }
+ }
+ if (j->first.find("<LANG>") != std::string::npos)
{
std::vector<std::string>::const_iterator k;
for (k = enLangs.begin(); k != enLangs.end(); ++k)