cmWrapExcludeFilesCommand.cxx 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. /*=========================================================================
  2. Program: Insight Segmentation & Registration Toolkit
  3. Module: $RCSfile$
  4. Language: C++
  5. Date: $Date$
  6. Version: $Revision$
  7. Copyright (c) 2002 Insight Consortium. All rights reserved.
  8. See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm 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 "cmWrapExcludeFilesCommand.h"
  14. // cmWrapExcludeFilesCommand
  15. bool cmWrapExcludeFilesCommand::InitialPass(std::vector<std::string> const& argsIn)
  16. {
  17. const char* versionValue
  18. = m_Makefile->GetDefinition("CMAKE_MINIMUM_REQUIRED_VERSION");
  19. if (versionValue && atof(versionValue) > 1.2)
  20. {
  21. this->SetError("The WRAP_EXCLUDE_FILES command has been deprecated in CMake version 1.4. You should use the SET_SOURCE_FILES_PROPERTIES command instead.\n");
  22. return false;
  23. }
  24. if(argsIn.size() < 1 )
  25. {
  26. this->SetError("called with incorrect number of arguments");
  27. return false;
  28. }
  29. std::vector<std::string> args;
  30. cmSystemTools::ExpandListArguments(argsIn, args);
  31. cmMakefile::SourceMap &Classes = m_Makefile->GetSources();
  32. for(std::vector<std::string>::const_iterator j = args.begin();
  33. j != args.end(); ++j)
  34. {
  35. for(cmMakefile::SourceMap::iterator l = Classes.begin();
  36. l != Classes.end(); l++)
  37. {
  38. for(std::vector<cmSourceFile*>::iterator i = l->second.begin();
  39. i != l->second.end(); i++)
  40. {
  41. if((*i)->GetSourceName() == (*j))
  42. {
  43. (*i)->SetWrapExclude(true);
  44. }
  45. }
  46. }
  47. }
  48. return true;
  49. }