[cmake-commits] king committed cmake.cxx 1.350 1.351

cmake-commits at cmake.org cmake-commits at cmake.org
Tue Jan 15 10:50:01 EST 2008


Update of /cvsroot/CMake/CMake/Source
In directory public:/mounts/ram/cvs-serv27454

Modified Files:
	cmake.cxx 
Log Message:
ENH: Added partial implementation of recognizing per-configration properties.


Index: cmake.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmake.cxx,v
retrieving revision 1.350
retrieving revision 1.351
diff -u -d -r1.350 -r1.351
--- cmake.cxx	3 Jan 2008 12:28:12 -0000	1.350
+++ cmake.cxx	15 Jan 2008 15:49:59 -0000	1.351
@@ -3324,6 +3324,15 @@
   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 @@
     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)



More information about the Cmake-commits mailing list