2004-09-22 22:42:05 +04:00
|
|
|
/*=========================================================================
|
|
|
|
|
|
|
|
Program: CMake - Cross-Platform Makefile Generator
|
|
|
|
Module: $RCSfile$
|
|
|
|
Language: C++
|
|
|
|
Date: $Date$
|
|
|
|
Version: $Revision$
|
|
|
|
|
|
|
|
Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved.
|
|
|
|
See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details.
|
|
|
|
|
|
|
|
This software is distributed WITHOUT ANY WARRANTY; without even
|
|
|
|
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
|
|
|
PURPOSE. See the above copyright notices for more information.
|
|
|
|
|
|
|
|
=========================================================================*/
|
|
|
|
#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;
|
|
|
|
}
|
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;
|
|
|
|
}
|
|
|
|
|