cmAbstractFilesCommand.cxx 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  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. #include <stdlib.h> // required for atof
  17. // cmAbstractFilesCommand
  18. bool cmAbstractFilesCommand::InitialPass(std::vector<std::string> const& args)
  19. {
  20. const char* versionValue
  21. = m_Makefile->GetDefinition("CMAKE_BACKWARDS_COMPATIBILITY");
  22. if (atof(versionValue) > 1.4)
  23. {
  24. 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");
  25. return false;
  26. }
  27. if (atof(versionValue) > 1.2)
  28. {
  29. 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");
  30. }
  31. bool ret = true;
  32. std::string m = "could not find source file(s):\n";
  33. for(std::vector<std::string>::const_iterator j = args.begin();
  34. j != args.end(); ++j)
  35. {
  36. cmSourceFile* sf = m_Makefile->GetSource(j->c_str());
  37. if(sf)
  38. {
  39. sf->SetProperty("ABSTRACT","1");
  40. }
  41. else
  42. {
  43. // for VTK 4.0 we have to support missing abstract sources
  44. if(m_Makefile->GetDefinition("CMAKE_MINIMUM_REQUIRED_VERSION"))
  45. {
  46. m += *j;
  47. m += "\n";
  48. ret = false;
  49. }
  50. }
  51. }
  52. if(!ret)
  53. {
  54. this->SetError(m.c_str());
  55. }
  56. return ret;
  57. }