Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
CMake
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Eli F-F
CMake
Commits
957bdb9e
Commit
957bdb9e
authored
8 years ago
by
Ruslan Baratov
Committed by
Brad King
8 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Help: Add example to MAP_IMPORTED_CONFIG_<CONFIG> docs
parent
1e0841c6
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Help/prop_tgt/MAP_IMPORTED_CONFIG_CONFIG.rst
+45
-0
45 additions, 0 deletions
Help/prop_tgt/MAP_IMPORTED_CONFIG_CONFIG.rst
with
45 additions
and
0 deletions
Help/prop_tgt/MAP_IMPORTED_CONFIG_CONFIG.rst
+
45
−
0
View file @
957bdb9e
...
...
@@ -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
)
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment