diff options
Diffstat (limited to 'Help/prop_tgt')
-rw-r--r-- | Help/prop_tgt/INTERFACE_BUILD_PROPERTY.txt | 16 | ||||
-rw-r--r-- | Help/prop_tgt/INTERFACE_COMPILE_DEFINITIONS.rst | 18 | ||||
-rw-r--r-- | Help/prop_tgt/INTERFACE_COMPILE_FEATURES.rst | 18 | ||||
-rw-r--r-- | Help/prop_tgt/INTERFACE_COMPILE_OPTIONS.rst | 18 | ||||
-rw-r--r-- | Help/prop_tgt/INTERFACE_INCLUDE_DIRECTORIES.rst | 29 | ||||
-rw-r--r-- | Help/prop_tgt/INTERFACE_LINK_LIBRARIES.rst | 6 | ||||
-rw-r--r-- | Help/prop_tgt/INTERFACE_SOURCES.rst | 13 | ||||
-rw-r--r-- | Help/prop_tgt/INTERFACE_SYSTEM_INCLUDE_DIRECTORIES.rst | 10 | ||||
-rw-r--r-- | Help/prop_tgt/LINK_INTERFACE_LIBRARIES.rst | 22 | ||||
-rw-r--r-- | Help/prop_tgt/LINK_INTERFACE_LIBRARIES_CONFIG.rst | 14 |
10 files changed, 90 insertions, 74 deletions
diff --git a/Help/prop_tgt/INTERFACE_BUILD_PROPERTY.txt b/Help/prop_tgt/INTERFACE_BUILD_PROPERTY.txt new file mode 100644 index 0000000..4188b8d --- /dev/null +++ b/Help/prop_tgt/INTERFACE_BUILD_PROPERTY.txt @@ -0,0 +1,16 @@ + +List of public |property_name| requirements for a library. + +Targets may populate this property to publish the |property_name| +required to compile against the headers for the target. The |command_name| +command populates this property with values given to the ``PUBLIC`` and +``INTERFACE`` keywords. Projects may also get and set the property directly. + +When target dependencies are specified using :command:`target_link_libraries`, +CMake will read this property from all target dependencies to determine the +build properties of the consumer. + +Contents of |PROPERTY_INTERFACE_NAME| may use "generator expressions" +with the syntax ``$<...>``. See the :manual:`cmake-generator-expressions(7)` +manual for available expressions. See the :manual:`cmake-buildsystem(7)` +-manual for more on defining buildsystem properties. diff --git a/Help/prop_tgt/INTERFACE_COMPILE_DEFINITIONS.rst b/Help/prop_tgt/INTERFACE_COMPILE_DEFINITIONS.rst index 910b661..c74a319 100644 --- a/Help/prop_tgt/INTERFACE_COMPILE_DEFINITIONS.rst +++ b/Help/prop_tgt/INTERFACE_COMPILE_DEFINITIONS.rst @@ -1,15 +1,9 @@ INTERFACE_COMPILE_DEFINITIONS ----------------------------- -List of public compile definitions for a library. - -Targets may populate this property to publish the compile definitions -required to compile against the headers for the target. Consuming -targets can add entries to their own :prop_tgt:`COMPILE_DEFINITIONS` -property such as ``$<TARGET_PROPERTY:foo,INTERFACE_COMPILE_DEFINITIONS>`` -to use the compile definitions specified in the interface of ``foo``. - -Contents of ``INTERFACE_COMPILE_DEFINITIONS`` may use "generator expressions" -with the syntax ``$<...>``. See the :manual:`cmake-generator-expressions(7)` -manual for available expressions. See the :manual:`cmake-buildsystem(7)` -manual for more on defining buildsystem properties. +.. |property_name| replace:: compile definitions +.. |command_name| replace:: :command:`target_compile_definitions` +.. |PROPERTY_INTERFACE_NAME| replace:: ``INTERFACE_COMPILE_DEFINITIONS`` +.. |PROPERTY_LINK| replace:: :prop_tgt:`COMPILE_DEFINITIONS` +.. |PROPERTY_GENEX| replace:: ``$<TARGET_PROPERTY:foo,INTERFACE_COMPILE_DEFINITIONS>`` +.. include:: INTERFACE_BUILD_PROPERTY.txt diff --git a/Help/prop_tgt/INTERFACE_COMPILE_FEATURES.rst b/Help/prop_tgt/INTERFACE_COMPILE_FEATURES.rst index 7abdecb..8dfec5f 100644 --- a/Help/prop_tgt/INTERFACE_COMPILE_FEATURES.rst +++ b/Help/prop_tgt/INTERFACE_COMPILE_FEATURES.rst @@ -1,16 +1,12 @@ INTERFACE_COMPILE_FEATURES -------------------------- -List of public compile requirements for a library. +.. |property_name| replace:: compile features +.. |command_name| replace:: :command:`target_compile_features` +.. |PROPERTY_INTERFACE_NAME| replace:: ``INTERFACE_COMPILE_FEATURES`` +.. |PROPERTY_LINK| replace:: :prop_tgt:`COMPILE_FEATURES` +.. |PROPERTY_GENEX| replace:: ``$<TARGET_PROPERTY:foo,INTERFACE_COMPILE_FEATURES>`` +.. include:: INTERFACE_BUILD_PROPERTY.txt -Targets may populate this property to publish the compiler features -required to compile against the headers for the target. Consuming -targets can add entries to their own :prop_tgt:`COMPILE_FEATURES` -property such as ``$<TARGET_PROPERTY:foo,INTERFACE_COMPILE_FEATURES>`` -to require the features specified in the interface of ``foo``. - -Contents of ``INTERFACE_COMPILE_FEATURES`` may use "generator expressions" -with the syntax ``$<...>``. See the :manual:`cmake-generator-expressions(7)` -manual for available expressions. See the -:manual:`cmake-compile-features(7)` manual for information on compile +See the :manual:`cmake-compile-features(7)` manual for information on compile features. diff --git a/Help/prop_tgt/INTERFACE_COMPILE_OPTIONS.rst b/Help/prop_tgt/INTERFACE_COMPILE_OPTIONS.rst index d0a38d6..7f0b385 100644 --- a/Help/prop_tgt/INTERFACE_COMPILE_OPTIONS.rst +++ b/Help/prop_tgt/INTERFACE_COMPILE_OPTIONS.rst @@ -1,15 +1,9 @@ INTERFACE_COMPILE_OPTIONS ------------------------- -List of interface options to pass to the compiler. - -Targets may populate this property to publish the compile options -required to compile against the headers for the target. Consuming -targets can add entries to their own :prop_tgt:`COMPILE_OPTIONS` property -such as ``$<TARGET_PROPERTY:foo,INTERFACE_COMPILE_OPTIONS>`` to use the -compile options specified in the interface of ``foo``. - -Contents of ``INTERFACE_COMPILE_OPTIONS`` may use "generator expressions" -with the syntax ``$<...>``. See the :manual:`cmake-generator-expressions(7)` -manual for available expressions. See the :manual:`cmake-buildsystem(7)` -manual for more on defining buildsystem properties. +.. |property_name| replace:: compile options +.. |command_name| replace:: :command:`target_compile_options` +.. |PROPERTY_INTERFACE_NAME| replace:: ``INTERFACE_COMPILE_OPTIONS`` +.. |PROPERTY_LINK| replace:: :prop_tgt:`COMPILE_OPTIONS` +.. |PROPERTY_GENEX| replace:: ``$<TARGET_PROPERTY:foo,INTERFACE_COMPILE_OPTIONS>`` +.. include:: INTERFACE_BUILD_PROPERTY.txt diff --git a/Help/prop_tgt/INTERFACE_INCLUDE_DIRECTORIES.rst b/Help/prop_tgt/INTERFACE_INCLUDE_DIRECTORIES.rst index 899e821..1cfd7a8 100644 --- a/Help/prop_tgt/INTERFACE_INCLUDE_DIRECTORIES.rst +++ b/Help/prop_tgt/INTERFACE_INCLUDE_DIRECTORIES.rst @@ -1,22 +1,12 @@ INTERFACE_INCLUDE_DIRECTORIES ----------------------------- -List of public include directories for a library. - -The :command:`target_include_directories` command populates this property -with values given to the ``PUBLIC`` and ``INTERFACE`` keywords. Projects -may also get and set the property directly. - -Targets may populate this property to publish the include directories -required to compile against the headers for the target. Consuming -targets can add entries to their own :prop_tgt:`INCLUDE_DIRECTORIES` -property such as ``$<TARGET_PROPERTY:foo,INTERFACE_INCLUDE_DIRECTORIES>`` -to use the include directories specified in the interface of ``foo``. - -Contents of ``INTERFACE_INCLUDE_DIRECTORIES`` may use "generator expressions" -with the syntax ``$<...>``. See the :manual:`cmake-generator-expressions(7)` -manual for available expressions. See the :manual:`cmake-buildsystem(7)` -manual for more on defining buildsystem properties. +.. |property_name| replace:: include directories +.. |command_name| replace:: :command:`target_include_directories` +.. |PROPERTY_INTERFACE_NAME| replace:: ``INTERFACE_INCLUDE_DIRECTORIES`` +.. |PROPERTY_LINK| replace:: :prop_tgt:`INCLUDE_DIRECTORIES` +.. |PROPERTY_GENEX| replace:: ``$<TARGET_PROPERTY:foo,INTERFACE_INCLUDE_DIRECTORIES>`` +.. include:: INTERFACE_BUILD_PROPERTY.txt Include directories usage requirements commonly differ between the build-tree and the install-tree. The ``BUILD_INTERFACE`` and ``INSTALL_INTERFACE`` @@ -27,7 +17,10 @@ installation prefix. For example: .. code-block:: cmake - set_property(TARGET mylib APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES + target_include_directories(mylib INTERFACE $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include/mylib> $<INSTALL_INTERFACE:include/mylib> # <prefix>/include/mylib - ) + ) + +.. |INTERFACE_PROPERTY_LINK| replace:: ``INTERFACE_INCLUDE_DIRECTORIES`` +.. include:: /include/INTERFACE_INCLUDE_DIRECTORIES_WARNING.txt diff --git a/Help/prop_tgt/INTERFACE_LINK_LIBRARIES.rst b/Help/prop_tgt/INTERFACE_LINK_LIBRARIES.rst index 8e4843b..55b7b8d 100644 --- a/Help/prop_tgt/INTERFACE_LINK_LIBRARIES.rst +++ b/Help/prop_tgt/INTERFACE_LINK_LIBRARIES.rst @@ -4,7 +4,8 @@ INTERFACE_LINK_LIBRARIES List public interface libraries for a library. This property contains the list of transitive link dependencies. When -the target is linked into another target the libraries listed (and +the target is linked into another target using the +:command:`target_link_libraries` command, the libraries listed (and recursively their link interface libraries) will be provided to the other target also. This property is overridden by the :prop_tgt:`LINK_INTERFACE_LIBRARIES` or @@ -15,3 +16,6 @@ Contents of ``INTERFACE_LINK_LIBRARIES`` may use "generator expressions" with the syntax ``$<...>``. See the :manual:`cmake-generator-expressions(7)` manual for available expressions. See the :manual:`cmake-buildsystem(7)` manual for more on defining buildsystem properties. + +.. |INTERFACE_PROPERTY_LINK| replace:: ``INTERFACE_LINK_LIBRARIES`` +.. include:: /include/INTERFACE_LINK_LIBRARIES_WARNING.txt diff --git a/Help/prop_tgt/INTERFACE_SOURCES.rst b/Help/prop_tgt/INTERFACE_SOURCES.rst index c8ca2e8..696ee95 100644 --- a/Help/prop_tgt/INTERFACE_SOURCES.rst +++ b/Help/prop_tgt/INTERFACE_SOURCES.rst @@ -1,13 +1,16 @@ INTERFACE_SOURCES ----------------- -List of interface sources to pass to the compiler. +List of interface sources to compile into consuming targets. Targets may populate this property to publish the sources -for consuming targets to compile. Consuming -targets can add entries to their own :prop_tgt:`SOURCES` property -such as ``$<TARGET_PROPERTY:foo,INTERFACE_SOURCES>`` to use the -sources specified in the interface of ``foo``. +for consuming targets to compile. The :command:`target_sources` command +populates this property with values given to the ``PUBLIC`` and +``INTERFACE`` keywords. Projects may also get and set the property directly. + +When target dependencies are specified using :command:`target_link_libraries`, +CMake will read this property from all target dependencies to determine the +sources of the consumer. Targets with ``INTERFACE_SOURCES`` may not be exported with the :command:`export` or :command:`install(EXPORT)` commands. This limitation may be diff --git a/Help/prop_tgt/INTERFACE_SYSTEM_INCLUDE_DIRECTORIES.rst b/Help/prop_tgt/INTERFACE_SYSTEM_INCLUDE_DIRECTORIES.rst index 9e603ee..b54b6c1 100644 --- a/Help/prop_tgt/INTERFACE_SYSTEM_INCLUDE_DIRECTORIES.rst +++ b/Help/prop_tgt/INTERFACE_SYSTEM_INCLUDE_DIRECTORIES.rst @@ -5,8 +5,14 @@ List of public system include directories for a library. Targets may populate this property to publish the include directories which contain system headers, and therefore should not result in -compiler warnings. Consuming targets will then mark the same include -directories as system headers. +compiler warnings. The :command:`target_include_directories(SYSTEM)` +command signature populates this property with values given to the +``PUBLIC`` and ``INTERFACE`` keywords. Projects may also get and set the +property directly. + +When target dependencies are specified using :command:`target_link_libraries`, +CMake will read this property from all target dependencies to mark the +same include directories as containing system headers. Contents of ``INTERFACE_SYSTEM_INCLUDE_DIRECTORIES`` may use "generator expressions" with the syntax ``$<...>``. See the diff --git a/Help/prop_tgt/LINK_INTERFACE_LIBRARIES.rst b/Help/prop_tgt/LINK_INTERFACE_LIBRARIES.rst index 435e25e..2e859eb 100644 --- a/Help/prop_tgt/LINK_INTERFACE_LIBRARIES.rst +++ b/Help/prop_tgt/LINK_INTERFACE_LIBRARIES.rst @@ -5,18 +5,24 @@ List public interface libraries for a shared library or executable. By default linking to a shared library target transitively links to targets with which the library itself was linked. For an executable -with exports (see the ENABLE_EXPORTS property) no default transitive -link dependencies are used. This property replaces the default +with exports (see the :prop_tgt:`ENABLE_EXPORTS` target property) no +default transitive link dependencies are used. This property replaces the default transitive link dependencies with an explicit list. When the target -is linked into another target the libraries listed (and recursively +is linked into another target using the :command:`target_link_libraries` +command, the libraries listed (and recursively their link interface libraries) will be provided to the other target also. If the list is empty then no transitive link dependencies will be incorporated when this target is linked into another target even if the default set is non-empty. This property is initialized by the -value of the variable CMAKE_LINK_INTERFACE_LIBRARIES if it is set when -a target is created. This property is ignored for STATIC libraries. +value of the :variable:`CMAKE_LINK_INTERFACE_LIBRARIES` variable if it is +set when a target is created. This property is ignored for ``STATIC`` +libraries. -This property is overridden by the INTERFACE_LINK_LIBRARIES property if -policy CMP0022 is NEW. +This property is overridden by the :prop_tgt:`INTERFACE_LINK_LIBRARIES` +property if policy :policy:`CMP0022` is ``NEW``. -This property is deprecated. Use INTERFACE_LINK_LIBRARIES instead. +This property is deprecated. Use :prop_tgt:`INTERFACE_LINK_LIBRARIES` +instead. + +.. |INTERFACE_PROPERTY_LINK| replace:: ``LINK_INTERFACE_LIBRARIES`` +.. include:: /include/INTERFACE_LINK_LIBRARIES_WARNING.txt diff --git a/Help/prop_tgt/LINK_INTERFACE_LIBRARIES_CONFIG.rst b/Help/prop_tgt/LINK_INTERFACE_LIBRARIES_CONFIG.rst index 08bd650..7f2b5dd 100644 --- a/Help/prop_tgt/LINK_INTERFACE_LIBRARIES_CONFIG.rst +++ b/Help/prop_tgt/LINK_INTERFACE_LIBRARIES_CONFIG.rst @@ -4,10 +4,14 @@ LINK_INTERFACE_LIBRARIES_<CONFIG> Per-configuration list of public interface libraries for a target. This is the configuration-specific version of -LINK_INTERFACE_LIBRARIES. If set, this property completely overrides -the generic property for the named configuration. +:prop_tgt:`LINK_INTERFACE_LIBRARIES`. If set, this property completely +overrides the generic property for the named configuration. -This property is overridden by the INTERFACE_LINK_LIBRARIES property if -policy CMP0022 is NEW. +This property is overridden by the :prop_tgt:`INTERFACE_LINK_LIBRARIES` +property if policy :policy:`CMP0022` is ``NEW``. -This property is deprecated. Use INTERFACE_LINK_LIBRARIES instead. +This property is deprecated. Use :prop_tgt:`INTERFACE_LINK_LIBRARIES` +instead. + +.. |INTERFACE_PROPERTY_LINK| replace:: ``LINK_INTERFACE_LIBRARIES_<CONFIG>`` +.. include:: /include/INTERFACE_LINK_LIBRARIES_WARNING.txt |