2009-09-28 15:43:28 +00:00
|
|
|
/*============================================================================
|
|
|
|
CMake - Cross Platform Makefile Generator
|
|
|
|
Copyright 2000-2009 Kitware, Inc., Insight Software Consortium
|
2004-09-22 18:42:05 +00:00
|
|
|
|
2009-09-28 15:43:28 +00:00
|
|
|
Distributed under the OSI-approved BSD License (the "License");
|
|
|
|
see accompanying file Copyright.txt for details.
|
2004-09-22 18:42:05 +00:00
|
|
|
|
2009-09-28 15:43:28 +00: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 18:42:05 +00:00
|
|
|
#include "cmEnableLanguageCommand.h"
|
|
|
|
|
|
|
|
// cmEnableLanguageCommand
|
2006-05-10 19:08:38 +00:00
|
|
|
bool cmEnableLanguageCommand
|
2008-01-23 15:28:26 +00:00
|
|
|
::InitialPass(std::vector<std::string> const& args, cmExecutionStatus &)
|
2004-09-22 18:42:05 +00:00
|
|
|
{
|
2007-06-28 13:09:26 +00:00
|
|
|
bool optional = false;
|
|
|
|
std::vector<std::string> languages;
|
2004-09-22 18:42:05 +00:00
|
|
|
if(args.size() < 1 )
|
|
|
|
{
|
2006-05-10 19:08:38 +00:00
|
|
|
this->SetError
|
2008-10-14 15:43:35 +00:00
|
|
|
("called with incorrect number of arguments");
|
2004-09-22 18:42:05 +00:00
|
|
|
return false;
|
2012-08-13 17:42:58 +00:00
|
|
|
}
|
2007-06-28 13:09:26 +00: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 18:42:05 +00:00
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|