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
This commit is contained in:
Alexander Neundorf
2007-06-28 09:09:26 -04:00
parent 53f39ad566
commit 43de8c8628
28 changed files with 77 additions and 42 deletions
+17 -1
View File
@@ -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;
}