cmAddCompileOptionsCommand.h 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. /*============================================================================
  2. CMake - Cross Platform Makefile Generator
  3. Copyright 2013 Stephen Kelly <[email protected]>
  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 cmAddCompileOptionsCommand_h
  11. #define cmAddCompileOptionsCommand_h
  12. #include "cmCommand.h"
  13. #include "cmDocumentGeneratorExpressions.h"
  14. class cmAddCompileOptionsCommand : public cmCommand
  15. {
  16. public:
  17. /**
  18. * This is a virtual constructor for the command.
  19. */
  20. virtual cmCommand* Clone()
  21. {
  22. return new cmAddCompileOptionsCommand;
  23. }
  24. /**
  25. * This is called when the command is first encountered in
  26. * the CMakeLists.txt file.
  27. */
  28. virtual bool InitialPass(std::vector<std::string> const& args,
  29. cmExecutionStatus &status);
  30. /**
  31. * The name of the command as specified in CMakeList.txt.
  32. */
  33. virtual const char* GetName() const {return "add_compile_options";}
  34. /**
  35. * Succinct documentation.
  36. */
  37. virtual const char* GetTerseDocumentation() const
  38. {
  39. return "Adds options to the compilation of source files.";
  40. }
  41. /**
  42. * More documentation.
  43. */
  44. virtual const char* GetFullDocumentation() const
  45. {
  46. return
  47. " add_compile_options(<option> ...)\n"
  48. "Adds options to the compiler command line for sources in the "
  49. "current directory and below. This command can be used to add any "
  50. "options, but alternative commands exist to add preprocessor "
  51. "definitions or include directories. "
  52. "See documentation of the directory and target COMPILE_OPTIONS "
  53. "properties for details. "
  54. "Arguments to add_compile_options may use \"generator "
  55. "expressions\" with the syntax \"$<...>\". "
  56. CM_DOCUMENT_COMMAND_GENERATOR_EXPRESSIONS
  57. CM_DOCUMENT_LANGUAGE_GENERATOR_EXPRESSIONS
  58. ;
  59. }
  60. cmTypeMacro(cmAddCompileOptionsCommand, cmCommand);
  61. };
  62. #endif