cmEnableLanguageCommand.cxx 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. /*=========================================================================
  2. Program: CMake - Cross-Platform Makefile Generator
  3. Module: $RCSfile$
  4. Language: C++
  5. Date: $Date$
  6. Version: $Revision$
  7. Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved.
  8. See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details.
  9. This software is distributed WITHOUT ANY WARRANTY; without even
  10. the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
  11. PURPOSE. See the above copyright notices for more information.
  12. =========================================================================*/
  13. #include "cmEnableLanguageCommand.h"
  14. // cmEnableLanguageCommand
  15. bool cmEnableLanguageCommand
  16. ::InitialPass(std::vector<std::string> const& args)
  17. {
  18. bool optional = false;
  19. std::vector<std::string> languages;
  20. if(args.size() < 1 )
  21. {
  22. this->SetError
  23. ("ENABLE_LANGUAGE called with incorrect number of arguments");
  24. return false;
  25. }
  26. for (std::vector<std::string>::const_iterator it = args.begin();
  27. it != args.end();
  28. ++it)
  29. {
  30. if ((*it) == "OPTIONAL")
  31. {
  32. optional = true;
  33. }
  34. else
  35. {
  36. languages.push_back(*it);
  37. }
  38. }
  39. this->Makefile->EnableLanguage(languages, optional);
  40. return true;
  41. }