INCLUDE_DIRECTORIES.rst 1.6 KB

1234567891011121314151617181920212223242526272829303132
  1. INCLUDE_DIRECTORIES
  2. -------------------
  3. List of preprocessor include file search directories.
  4. This property specifies the list of directories given so far to the
  5. :command:`include_directories` command.
  6. This property is used to populate the :prop_tgt:`INCLUDE_DIRECTORIES`
  7. target property, which is used by the generators to set the include
  8. directories for the compiler.
  9. In addition to accepting values from that command, values may be set
  10. directly on any directory using the :command:`set_property` command, and can be
  11. set on the current directory using the :command:`set_directory_properties`
  12. command. A directory gets its initial value from its parent directory if it has
  13. one. The initial value of the :prop_tgt:`INCLUDE_DIRECTORIES` target property
  14. comes from the value of this property. Both directory and target property
  15. values are adjusted by calls to the :command:`include_directories` command.
  16. Calls to :command:`set_property` or :command:`set_directory_properties`,
  17. however, will update the directory property value without updating target
  18. property values. Therefore direct property updates must be made before
  19. calls to :command:`add_executable` or :command:`add_library` for targets
  20. they are meant to affect.
  21. The target property values are used by the generators to set the
  22. include paths for the compiler.
  23. Contents of ``INCLUDE_DIRECTORIES`` may use "generator expressions" with
  24. the syntax ``$<...>``. See the :manual:`cmake-generator-expressions(7)`
  25. manual for available expressions. See the :manual:`cmake-buildsystem(7)`
  26. manual for more on defining buildsystem properties.