2016-09-27 22:01:08 +03:00
|
|
|
/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
|
|
|
|
file Copyright.txt or https://cmake.org/licensing for details. */
|
2004-09-22 22:42:05 +04:00
|
|
|
#include "cmEnableLanguageCommand.h"
|
|
|
|
|
|
|
|
// cmEnableLanguageCommand
|
2016-05-16 17:34:04 +03:00
|
|
|
bool cmEnableLanguageCommand::InitialPass(std::vector<std::string> const& args,
|
|
|
|
cmExecutionStatus&)
|
2004-09-22 22:42:05 +04:00
|
|
|
{
|
2007-06-28 17:09:26 +04:00
|
|
|
bool optional = false;
|
|
|
|
std::vector<std::string> languages;
|
2016-09-16 00:59:29 +03:00
|
|
|
if (args.empty()) {
|
2016-05-16 17:34:04 +03:00
|
|
|
this->SetError("called with incorrect number of arguments");
|
2004-09-22 22:42:05 +04:00
|
|
|
return false;
|
2016-05-16 17:34:04 +03:00
|
|
|
}
|
2007-06-28 17:09:26 +04:00
|
|
|
for (std::vector<std::string>::const_iterator it = args.begin();
|
2016-05-16 17:34:04 +03:00
|
|
|
it != args.end(); ++it) {
|
|
|
|
if ((*it) == "OPTIONAL") {
|
2007-06-28 17:09:26 +04:00
|
|
|
optional = true;
|
2016-05-16 17:34:04 +03:00
|
|
|
} else {
|
2007-06-28 17:09:26 +04:00
|
|
|
languages.push_back(*it);
|
|
|
|
}
|
2016-05-16 17:34:04 +03:00
|
|
|
}
|
2007-06-28 17:09:26 +04:00
|
|
|
|
|
|
|
this->Makefile->EnableLanguage(languages, optional);
|
2004-09-22 22:42:05 +04:00
|
|
|
return true;
|
|
|
|
}
|