cmTargetIncludeDirectoriesCommand.h 3.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  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 cmTargetIncludeDirectoriesCommand_h
  11. #define cmTargetIncludeDirectoriesCommand_h
  12. #include "cmTargetPropCommandBase.h"
  13. //----------------------------------------------------------------------------
  14. class cmTargetIncludeDirectoriesCommand : public cmTargetPropCommandBase
  15. {
  16. public:
  17. /**
  18. * This is a virtual constructor for the command.
  19. */
  20. virtual cmCommand* Clone()
  21. {
  22. return new cmTargetIncludeDirectoriesCommand;
  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 "target_include_directories";}
  34. /**
  35. * Succinct documentation.
  36. */
  37. virtual const char* GetTerseDocumentation() const
  38. {
  39. return
  40. "Add include directories to a target.";
  41. }
  42. /**
  43. * More documentation.
  44. */
  45. virtual const char* GetFullDocumentation() const
  46. {
  47. return
  48. " target_include_directories(<target> [BEFORE] "
  49. "<INTERFACE|PUBLIC|PRIVATE> [items1...]\n"
  50. " [<INTERFACE|PUBLIC|PRIVATE> [items2...] ...])\n"
  51. "Specify include directories or targets to use when compiling a given "
  52. "target. "
  53. "The named <target> must have been created by a command such as "
  54. "add_executable or add_library.\n"
  55. "If BEFORE is specified, the content will be prepended to the property "
  56. "instead of being appended.\n"
  57. "The INTERFACE, PUBLIC and PRIVATE keywords are required to specify "
  58. "the scope of the following arguments. PRIVATE and PUBLIC items will "
  59. "populate the INCLUDE_DIRECTORIES property of <target>. PUBLIC and "
  60. "INTERFACE items will populate the INTERFACE_INCLUDE_DIRECTORIES "
  61. "property of <target>. "
  62. "The non-scope arguments specify either include directories or targets "
  63. "to use INTERFACE_INCLUDE_DIRECTORIES from. Any specified include "
  64. "directories must be absolute paths, not relative paths. "
  65. "Repeated calls for the same <target> append items in the order called."
  66. "\n"
  67. ;
  68. }
  69. cmTypeMacro(cmTargetIncludeDirectoriesCommand, cmCommand);
  70. private:
  71. virtual void HandleImportedTargetInvalidScope(const std::string &tgt,
  72. const std::string &scope);
  73. virtual void HandleMissingTarget(const std::string &name);
  74. virtual bool HandleNonTargetArg(std::string &content,
  75. const std::string &sep,
  76. const std::string &entry,
  77. const std::string &tgt);
  78. virtual void HandleDirectContent(cmTarget *tgt, const std::string &content,
  79. bool prepend);
  80. };
  81. #endif