cmAbstractFilesCommand.cxx 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  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. for(std::vector<std::string>::const_iterator j = args.begin();
  27. j != args.end(); ++j)
  28. {
  29. cmSourceFile* sf = m_Makefile->GetSource(j->c_str());
  30. if(sf)
  31. {
  32. sf->SetIsAnAbstractClass(true);
  33. }
  34. else
  35. {
  36. // for VTK 4.0 we have to support missing abstract sources
  37. if(m_Makefile->GetDefinition("CMAKE_MINIMUM_REQUIRED_VERSION"))
  38. {
  39. m += *j;
  40. m += "\n";
  41. ret = false;
  42. }
  43. }
  44. }
  45. if(!ret)
  46. {
  47. this->SetError(m.c_str());
  48. }
  49. return ret;
  50. }