2009-09-28 19:43:28 +04:00
|
|
|
/*============================================================================
|
|
|
|
CMake - Cross Platform Makefile Generator
|
|
|
|
Copyright 2000-2009 Kitware, Inc., Insight Software Consortium
|
2004-09-22 22:42:05 +04:00
|
|
|
|
2009-09-28 19:43:28 +04:00
|
|
|
Distributed under the OSI-approved BSD License (the "License");
|
|
|
|
see accompanying file Copyright.txt for details.
|
2004-09-22 22:42:05 +04:00
|
|
|
|
2009-09-28 19:43:28 +04:00
|
|
|
This software is distributed WITHOUT ANY WARRANTY; without even the
|
|
|
|
implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
|
|
See the License for more information.
|
|
|
|
============================================================================*/
|
2004-09-22 22:42:05 +04:00
|
|
|
#include "cmEnableLanguageCommand.h"
|
|
|
|
|
|
|
|
// cmEnableLanguageCommand
|
2006-05-10 23:08:38 +04:00
|
|
|
bool cmEnableLanguageCommand
|
2008-01-23 18:28:26 +03:00
|
|
|
::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;
|
2004-09-22 22:42:05 +04:00
|
|
|
if(args.size() < 1 )
|
|
|
|
{
|
2006-05-10 23:08:38 +04:00
|
|
|
this->SetError
|
2008-10-14 19:43:35 +04:00
|
|
|
("called with incorrect number of arguments");
|
2004-09-22 22:42:05 +04:00
|
|
|
return false;
|
2012-08-13 21:42:58 +04:00
|
|
|
}
|
2007-06-28 17:09:26 +04:00
|
|
|
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);
|
2004-09-22 22:42:05 +04:00
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|