cmTargetIncludeDirectoriesCommand.h 3.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  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 and must not be an IMPORTED target.\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. "Arguments to target_include_directories may use \"generator "
  68. "expressions\" with the syntax \"$<...>\". "
  69. CM_DOCUMENT_COMMAND_GENERATOR_EXPRESSIONS
  70. ;
  71. }
  72. cmTypeMacro(cmTargetIncludeDirectoriesCommand, cmTargetPropCommandBase);
  73. private:
  74. virtual void HandleImportedTarget(const std::string &tgt);
  75. virtual void HandleMissingTarget(const std::string &name);
  76. virtual void HandleDirectContent(cmTarget *tgt,
  77. const std::vector<std::string> &content,
  78. bool prepend);
  79. virtual std::string Join(const std::vector<std::string> &content);
  80. };
  81. #endif