cmAbstractFilesCommand.cxx 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  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 "cmAbstractFilesCommand.h"
  14. // cmAbstractFilesCommand
  15. bool cmAbstractFilesCommand::InitialPass(std::vector<std::string> const& argsIn)
  16. {
  17. if(argsIn.size() < 1 )
  18. {
  19. this->SetError("called with incorrect number of arguments");
  20. return false;
  21. }
  22. std::vector<std::string> args;
  23. cmSystemTools::ExpandListArguments(argsIn, args);
  24. bool ret = true;
  25. std::string m = "could not find source file(s):\n";
  26. cmMakefile::SourceMap &Classes = m_Makefile->GetSources();
  27. for(std::vector<std::string>::const_iterator j = args.begin();
  28. j != args.end(); ++j)
  29. {
  30. cmSourceFile* sf = m_Makefile->GetSource(j->c_str());
  31. if(sf)
  32. {
  33. sf->SetIsAnAbstractClass(true);
  34. }
  35. else
  36. {
  37. m += *j;
  38. m += "\n";
  39. ret = false;
  40. }
  41. }
  42. if(!ret)
  43. {
  44. this->SetError(m.c_str());
  45. }
  46. return ret;
  47. }