cmAbstractFilesCommand.cxx 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  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 "cmAbstractFilesCommand.h"
  14. #include "cmMakefile.h"
  15. #include "cmSourceFile.h"
  16. // cmAbstractFilesCommand
  17. bool cmAbstractFilesCommand::InitialPass(std::vector<std::string> const& argsIn)
  18. {
  19. const char* versionValue
  20. = m_Makefile->GetDefinition("CMAKE_MINIMUM_REQUIRED_VERSION");
  21. if (versionValue && atof(versionValue) > 1.2)
  22. {
  23. this->SetError("The ABSTRACT_FILES command has been deprecated in CMake version 1.4. You should use the SET_SOURCE_FILES_PROPERTIES command instead.\n");
  24. return false;
  25. }
  26. if(argsIn.size() < 1 )
  27. {
  28. this->SetError("called with incorrect number of arguments");
  29. return false;
  30. }
  31. std::vector<std::string> args;
  32. cmSystemTools::ExpandListArguments(argsIn, args);
  33. bool ret = true;
  34. std::string m = "could not find source file(s):\n";
  35. for(std::vector<std::string>::const_iterator j = args.begin();
  36. j != args.end(); ++j)
  37. {
  38. cmSourceFile* sf = m_Makefile->GetSource(j->c_str());
  39. if(sf)
  40. {
  41. sf->SetProperty("ABSTRACT","1");
  42. }
  43. else
  44. {
  45. // for VTK 4.0 we have to support missing abstract sources
  46. if(m_Makefile->GetDefinition("CMAKE_MINIMUM_REQUIRED_VERSION"))
  47. {
  48. m += *j;
  49. m += "\n";
  50. ret = false;
  51. }
  52. }
  53. }
  54. if(!ret)
  55. {
  56. this->SetError(m.c_str());
  57. }
  58. return ret;
  59. }