[Cmake-commits] [cmake-commits] hoffman committed cmake.cxx 1.385 1.386

cmake-commits at cmake.org cmake-commits at cmake.org
Tue Jun 17 13:13:23 EDT 2008


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

Modified Files:
	cmake.cxx 
Log Message:
ENH: add an enabled language property


Index: cmake.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmake.cxx,v
retrieving revision 1.385
retrieving revision 1.386
diff -C 2 -d -r1.385 -r1.386
*** cmake.cxx	8 Jun 2008 15:41:24 -0000	1.385
--- cmake.cxx	17 Jun 2008 17:13:21 -0000	1.386
***************
*** 3376,3379 ****
--- 3376,3384 ----
       "Read-only property that is true during a try-compile configuration.",
       "True when building a project inside a TRY_COMPILE or TRY_RUN command.");
+   cm->DefineProperty
+     ("ENABLED_LANGUAGES", cmProperty::GLOBAL,
+      "Read-only property that contains the list of currently "
+      "enabled languages",
+      "Set to list of currently enabled lanauges.");
  
    // ================================================================
***************
*** 3591,3594 ****
--- 3596,3617 ----
                        this->GetIsInTryCompile()? "1":"0");
      }
+   else if ( propname == "ENABLED_LANGUAGES" )
+     {
+     std::string lang;
+     if(this->GlobalGenerator)
+       {
+       std::vector<std::string> enLangs;
+       this->GlobalGenerator->GetEnabledLanguages(enLangs);
+       const char* sep = "";
+       for(std::vector<std::string>::iterator i = enLangs.begin();
+           i != enLangs.end(); ++i)
+         {
+         lang += sep;
+         sep = ";";
+         lang += *i;
+         }
+       }
+     this->SetProperty("ENABLED_LANGUAGES", lang.c_str());
+     }
    return this->Properties.GetPropertyValue(prop, scope, chain);
  }



More information about the Cmake-commits mailing list