Commit 6fbd9a8f authored by Stephen Kelly's avatar Stephen Kelly Committed by Brad King
Browse files

Help: Add code example for INSTALL_INTERFACE to cmake-buildsystem.

parent cbc9a951
......@@ -580,7 +580,17 @@ and the install-tree. The ``BUILD_INTERFACE`` and ``INSTALL_INTERFACE``
generator expressions can be used to describe separate usage requirements
based on the usage location. Relative paths are allowed within these
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
requirements. The :variable:`CMAKE_INCLUDE_CURRENT_DIR_IN_INTERFACE` variable
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment