summaryrefslogtreecommitdiffstats
path: root/Source/cmEnableLanguageCommand.cxx
diff options
context:
space:
mode:
authorAlexander Neundorf <neundorf@kde.org>2007-06-28 13:09:26 (GMT)
committerAlexander Neundorf <neundorf@kde.org>2007-06-28 13:09:26 (GMT)
commit43de8c862868be38ce5ffe91edf09898ef8478cf (patch)
tree90a54e2fc57511c61b271a9bd6e01f6b4096d35a /Source/cmEnableLanguageCommand.cxx
parent53f39ad566ec7b9b3c118164d5330c0d17dd18c1 (diff)
downloadCMake-43de8c862868be38ce5ffe91edf09898ef8478cf.zip
CMake-43de8c862868be38ce5ffe91edf09898ef8478cf.tar.gz
CMake-43de8c862868be38ce5ffe91edf09898ef8478cf.tar.bz2
ENH: add OPTIONAL keyword to ENABLE_LANGUAGE, so it will be possible to do
something like this: ENABLE_LANGUAGE(ASM-ATT) IF(CMAKE_ASM-ATT_COMPILER_WORKS) ... do assembler stufff ELSE(CMAKE_ASM-ATT_COMPILER_WORKS) ... fallback to generic C/C++ ENDIF(CMAKE_ASM-ATT_COMPILER_WORKS) Alex
Diffstat (limited to 'Source/cmEnableLanguageCommand.cxx')
-rw-r--r--Source/cmEnableLanguageCommand.cxx18
1 files changed, 17 insertions, 1 deletions
diff --git a/Source/cmEnableLanguageCommand.cxx b/Source/cmEnableLanguageCommand.cxx
index c778884..2713b62 100644
--- a/Source/cmEnableLanguageCommand.cxx
+++ b/Source/cmEnableLanguageCommand.cxx
@@ -20,13 +20,29 @@
bool cmEnableLanguageCommand
::InitialPass(std::vector<std::string> const& args)
{
+ bool optional = false;
+ std::vector<std::string> languages;
if(args.size() < 1 )
{
this->SetError
("ENABLE_LANGUAGE called with incorrect number of arguments");
return false;
}
- this->Makefile->EnableLanguage(args);
+ for (std::vector<std::string>::const_iterator it = args.begin();
+ it != args.end();
+ ++it)
+ {
+ if ((*it) == "OPTIONAL")
+ {
+ optional = true;
+ }
+ else
+ {
+ languages.push_back(*it);
+ }
+ }
+
+ this->Makefile->EnableLanguage(languages, optional);
return true;
}