cmAbstractFilesCommand.cxx 1.4 KB

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