From 5b5cd07d8de6bc5f59aa02da4076b1e5df4a9cb2 Mon Sep 17 00:00:00 2001 From: Bill Hoffman Date: Tue, 17 Jun 2008 13:13:21 -0400 Subject: ENH: add an enabled language property --- Source/cmake.cxx | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) 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 enLangs; + this->GlobalGenerator->GetEnabledLanguages(enLangs); + const char* sep = ""; + for(std::vector::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); } -- cgit v0.12