summaryrefslogtreecommitdiffstats
path: root/Source/cmake.cxx
diff options
context:
space:
mode:
authorBill Hoffman <bill.hoffman@kitware.com>2008-06-17 17:13:21 (GMT)
committerBill Hoffman <bill.hoffman@kitware.com>2008-06-17 17:13:21 (GMT)
commit5b5cd07d8de6bc5f59aa02da4076b1e5df4a9cb2 (patch)
tree3850e7a692bb04f8c499766866246313cc80223c /Source/cmake.cxx
parent9a98928bd9862714ccbfe62158e76760efa324ca (diff)
downloadCMake-5b5cd07d8de6bc5f59aa02da4076b1e5df4a9cb2.zip
CMake-5b5cd07d8de6bc5f59aa02da4076b1e5df4a9cb2.tar.gz
CMake-5b5cd07d8de6bc5f59aa02da4076b1e5df4a9cb2.tar.bz2
ENH: add an enabled language property
Diffstat (limited to 'Source/cmake.cxx')
-rw-r--r--Source/cmake.cxx23
1 files changed, 23 insertions, 0 deletions
diff --git a/Source/cmake.cxx b/Source/cmake.cxx
index 4dffe0c..cbb8ba7 100644
--- a/Source/cmake.cxx
+++ b/Source/cmake.cxx
@@ -3375,6 +3375,11 @@ void cmake::DefineProperties(cmake *cm)
("IN_TRY_COMPILE", cmProperty::GLOBAL,
"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.");
// ================================================================
// define variables as well
@@ -3590,6 +3595,24 @@ const char *cmake::GetProperty(const char* prop, cmProperty::ScopeType scope)
this->SetProperty("IN_TRY_COMPILE",
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);
}