diff options
author | Ruslan Baratov <ruslan_baratov@yahoo.com> | 2017-03-03 10:01:57 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2017-03-06 18:14:34 (GMT) |
commit | 957bdb9e6e4d8e0855f3a9d98cbc6a196bb07293 (patch) | |
tree | 1fdf73406bef82312c8d1e7efa60b44423ff95ed /Help/prop_tgt/MAP_IMPORTED_CONFIG_CONFIG.rst | |
parent | 1e0841c67244c70641a18c348cd8a274f4789010 (diff) | |
download | CMake-957bdb9e6e4d8e0855f3a9d98cbc6a196bb07293.zip CMake-957bdb9e6e4d8e0855f3a9d98cbc6a196bb07293.tar.gz CMake-957bdb9e6e4d8e0855f3a9d98cbc6a196bb07293.tar.bz2 |
Help: Add example to MAP_IMPORTED_CONFIG_<CONFIG> docs
Diffstat (limited to 'Help/prop_tgt/MAP_IMPORTED_CONFIG_CONFIG.rst')
-rw-r--r-- | Help/prop_tgt/MAP_IMPORTED_CONFIG_CONFIG.rst | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/Help/prop_tgt/MAP_IMPORTED_CONFIG_CONFIG.rst b/Help/prop_tgt/MAP_IMPORTED_CONFIG_CONFIG.rst index 4da855b..266ccf0 100644 --- a/Help/prop_tgt/MAP_IMPORTED_CONFIG_CONFIG.rst +++ b/Help/prop_tgt/MAP_IMPORTED_CONFIG_CONFIG.rst @@ -23,3 +23,48 @@ is ignored for non-imported targets. This property is initialized by the value of the :variable:`CMAKE_MAP_IMPORTED_CONFIG_<CONFIG>` variable if it is set when a target is created. + +Example +^^^^^^^ + +For example creating imported C++ library ``foo``: + +.. code-block:: cmake + + add_library(foo STATIC IMPORTED) + +Use ``foo_debug`` path for ``Debug`` build type: + +.. code-block:: cmake + + set_property( + TARGET foo APPEND PROPERTY IMPORTED_CONFIGURATIONS DEBUG + ) + + set_target_properties(foo PROPERTIES + IMPORTED_LINK_INTERFACE_LANGUAGES_DEBUG "CXX" + IMPORTED_LOCATION_DEBUG "${foo_debug}" + ) + +Use ``foo_release`` path for ``Release`` build type: + +.. code-block:: cmake + + set_property( + TARGET foo APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE + ) + + set_target_properties(foo PROPERTIES + IMPORTED_LINK_INTERFACE_LANGUAGES_RELEASE "CXX" + IMPORTED_LOCATION_RELEASE "${foo_release}" + ) + +Use ``Release`` version of library for ``MinSizeRel`` and ``RelWithDebInfo`` +build types: + +.. code-block:: cmake + + set_target_properties(foo PROPERTIES + MAP_IMPORTED_CONFIG_MINSIZEREL Release + MAP_IMPORTED_CONFIG_RELWITHDEBINFO Release + ) |