cmAbstractFilesCommand.cxx 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  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& args)
  18. {
  19. const char* versionValue
  20. = m_Makefile->GetDefinition("CMAKE_BACKWARDS_COMPATIBILITY");
  21. if (atof(versionValue) > 1.4)
  22. {
  23. this->SetError("The ABSTRACT_FILES command was deprecated in CMake version 1.4 and will be removed in later versions of CMake. You should modify your CMakeLists.txt files to use the SET command instead, or set the cache value of CMAKE_BACKWARDS_COMPATIBILITY to 1.2 or less.\n");
  24. return false;
  25. }
  26. if (atof(versionValue) > 1.2)
  27. {
  28. cmSystemTools::Message("The ABSTRACT_FILES command was deprecated in CMake version 1.4 and will be removed in later versions. You should modify your CMakeLists.txt files to use the SET command instead, or set the cache value of CMAKE_BACKWARDS_COMPATIBILITY to 1.2 or less.\n","Warning");
  29. }
  30. bool ret = true;
  31. std::string m = "could not find source file(s):\n";
  32. for(std::vector<std::string>::const_iterator j = args.begin();
  33. j != args.end(); ++j)
  34. {
  35. cmSourceFile* sf = m_Makefile->GetSource(j->c_str());
  36. if(sf)
  37. {
  38. sf->SetProperty("ABSTRACT","1");
  39. }
  40. else
  41. {
  42. // for VTK 4.0 we have to support missing abstract sources
  43. if(m_Makefile->GetDefinition("CMAKE_MINIMUM_REQUIRED_VERSION"))
  44. {
  45. m += *j;
  46. m += "\n";
  47. ret = false;
  48. }
  49. }
  50. }
  51. if(!ret)
  52. {
  53. this->SetError(m.c_str());
  54. }
  55. return ret;
  56. }