Merge topic 'CMP0052-docs'
692228e4 Help: Link to cmake-buildsystem from CMP0052 docs. e5e9b8e9 Help: Add code example for INSTALL_INTERFACE to cmake-buildsystem.
This commit is contained in:
commit
a0972532b3
@ -580,7 +580,17 @@ and the install-tree. The ``BUILD_INTERFACE`` and ``INSTALL_INTERFACE``
|
|||||||
generator expressions can be used to describe separate usage requirements
|
generator expressions can be used to describe separate usage requirements
|
||||||
based on the usage location. Relative paths are allowed within these
|
based on the usage location. Relative paths are allowed within these
|
||||||
expressions, and are interpreted relative to the current source directory
|
expressions, and are interpreted relative to the current source directory
|
||||||
or the installation prefix, as appropriate.
|
or the installation prefix, as appropriate:
|
||||||
|
|
||||||
|
.. code-block:: cmake
|
||||||
|
|
||||||
|
add_library(ClimbingStats climbingstats.cpp)
|
||||||
|
target_include_directories(ClimbingStats INTERFACE
|
||||||
|
$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}/generated>
|
||||||
|
$<INSTALL_INTERFACE:/absolute/path>
|
||||||
|
$<INSTALL_INTERFACE:relative/path>
|
||||||
|
$<INSTALL_INTERFACE:$<INSTALL_PREFIX>/$<CONFIG>/generated>
|
||||||
|
)
|
||||||
|
|
||||||
Two convenience APIs are provided relating to include directories usage
|
Two convenience APIs are provided relating to include directories usage
|
||||||
requirements. The :variable:`CMAKE_INCLUDE_CURRENT_DIR_IN_INTERFACE` variable
|
requirements. The :variable:`CMAKE_INCLUDE_CURRENT_DIR_IN_INTERFACE` variable
|
||||||
|
@ -10,6 +10,9 @@ the installation prefix. This makes the installation depend on the
|
|||||||
existence of the source dir or binary dir, and the installation will be
|
existence of the source dir or binary dir, and the installation will be
|
||||||
broken if either are removed after installation.
|
broken if either are removed after installation.
|
||||||
|
|
||||||
|
See :ref:`Include Directories and Usage Requirements` for more on
|
||||||
|
specifying include directories for targets.
|
||||||
|
|
||||||
The OLD behavior for this policy is to export the content of the
|
The OLD behavior for this policy is to export the content of the
|
||||||
:prop_tgt:`INTERFACE_INCLUDE_DIRECTORIES` with the source or binary
|
:prop_tgt:`INTERFACE_INCLUDE_DIRECTORIES` with the source or binary
|
||||||
directory. The NEW behavior for this
|
directory. The NEW behavior for this
|
||||||
|
Loading…
x
Reference in New Issue
Block a user