cmSourceFilesCommand.h 2.7 KB

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