cmSourceFilesCommand.h 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  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. #ifndef cmSourceFilesCommand_h
  14. #define cmSourceFilesCommand_h
  15. #include "cmStandardIncludes.h"
  16. #include "cmCommand.h"
  17. /** \class cmSourceFilesCommand
  18. * \brief Add source files to the build.
  19. *
  20. * cmSourceFilesCommand adds source files to the build. The source
  21. * files will be added to the current library (if defined by the
  22. * LIBRARY(library) command. Use this command to add source files not
  23. * dependent on other packages (use SOURCE_FILES_REQUIRED() to add
  24. * dependent source files).
  25. *
  26. * It allows sources to be added even if they are generated by a build
  27. * process. This can be achieved usiong GENERATED keyword:
  28. * SOURCE_FILES( Project_SRCS
  29. * Source1
  30. * Source2
  31. * ...
  32. * GENERATED
  33. * SourceThatDoesNotExist )
  34. *
  35. * \sa cmSourceFilesRequireCommand
  36. */
  37. class cmSourceFilesCommand : public cmCommand
  38. {
  39. public:
  40. /**
  41. * This is a virtual constructor for the command.
  42. */
  43. virtual cmCommand* Clone()
  44. {
  45. return new cmSourceFilesCommand;
  46. }
  47. /**
  48. * This is called when the command is first encountered in
  49. * the CMakeLists.txt file.
  50. */
  51. virtual bool InitialPass(std::vector<std::string> const& args);
  52. /**
  53. * The name of the command as specified in CMakeList.txt.
  54. */
  55. virtual const char* GetName() { return "SOURCE_FILES";}
  56. /**
  57. * Succinct documentation.
  58. */
  59. virtual const char* GetTerseDocumentation()
  60. {
  61. return "Deprecated. Use SET to list sources in a variable.";
  62. }
  63. /**
  64. * This determines if the method is deprecated or not
  65. */
  66. virtual bool IsDeprecated(int major, int minor);
  67. /**
  68. * More documentation.
  69. */
  70. virtual const char* GetFullDocumentation()
  71. {
  72. return
  73. " SOURCE_FILES(variable file1 file2 ...\n"
  74. " [ GENERATED generated_file1 ... ])\n"
  75. "Adds the given sources to the list in the given variable. Sources "
  76. "listed after GENERATED will be given the GENERATED property. See "
  77. "SET_SOURCE_FILES_PROPERTIES to add the GENERATED property to any "
  78. "source.";
  79. }
  80. cmTypeMacro(cmSourceFilesCommand, cmCommand);
  81. };
  82. #endif