cmSetSourceFilesPropertiesCommand.h 3.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. /*============================================================================
  2. CMake - Cross Platform Makefile Generator
  3. Copyright 2000-2009 Kitware, Inc., Insight Software Consortium
  4. Distributed under the OSI-approved BSD License (the "License");
  5. see accompanying file Copyright.txt for details.
  6. This software is distributed WITHOUT ANY WARRANTY; without even the
  7. implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  8. See the License for more information.
  9. ============================================================================*/
  10. #ifndef cmSetSourceFilesPropertiesCommand_h
  11. #define cmSetSourceFilesPropertiesCommand_h
  12. #include "cmCommand.h"
  13. class cmSetSourceFilesPropertiesCommand : public cmCommand
  14. {
  15. public:
  16. virtual cmCommand* Clone()
  17. {
  18. return new cmSetSourceFilesPropertiesCommand;
  19. }
  20. /**
  21. * This is called when the command is first encountered in
  22. * the input file.
  23. */
  24. virtual bool InitialPass(std::vector<std::string> const& args,
  25. cmExecutionStatus &status);
  26. /**
  27. * The name of the command as specified in CMakeList.txt.
  28. */
  29. virtual const char* GetName() { return "set_source_files_properties";}
  30. /**
  31. * Succinct documentation.
  32. */
  33. virtual const char* GetTerseDocumentation()
  34. {
  35. return "Source files can have properties that affect how they are built.";
  36. }
  37. /**
  38. * Longer documentation.
  39. */
  40. virtual const char* GetFullDocumentation()
  41. {
  42. return
  43. " set_source_files_properties(file1 file2 ...\n"
  44. " PROPERTIES prop1 value1\n"
  45. " prop2 value2 ...)\n"
  46. "Set properties on a file. The syntax for the command is to list all "
  47. "the files you want "
  48. "to change, and then provide the values you want to set next. You "
  49. "can make up your own properties as well. "
  50. "The following are used by CMake. "
  51. "The ABSTRACT flag (boolean) is used by some class wrapping "
  52. "commands. "
  53. "If WRAP_EXCLUDE (boolean) is true then many wrapping commands "
  54. "will ignore this file. If GENERATED (boolean) is true then it "
  55. "is not an error if this source file does not exist when it is "
  56. "added to a target. Obviously, "
  57. "it must be created (presumably by a custom command) before the "
  58. "target is built. "
  59. "If the HEADER_FILE_ONLY (boolean) property is true then the "
  60. "file is not compiled. This is useful if you want to add extra "
  61. "non build files to an IDE. "
  62. "OBJECT_DEPENDS (string) adds dependencies to the object file. "
  63. "COMPILE_FLAGS (string) is passed to the compiler as additional "
  64. "command line arguments when the source file is compiled. "
  65. "LANGUAGE (string) CXX|C will change the default compiler used "
  66. "to compile the source file. The languages used need to be enabled "
  67. "in the PROJECT command. "
  68. "If SYMBOLIC (boolean) is set to true the build system will be "
  69. "informed that the source file is not actually created on disk but "
  70. "instead used as a symbolic name for a build rule.";
  71. }
  72. cmTypeMacro(cmSetSourceFilesPropertiesCommand, cmCommand);
  73. static bool RunCommand(cmMakefile *mf,
  74. std::vector<std::string>::const_iterator filebeg,
  75. std::vector<std::string>::const_iterator fileend,
  76. std::vector<std::string>::const_iterator propbeg,
  77. std::vector<std::string>::const_iterator propend,
  78. std::string &errors);
  79. };
  80. #endif