summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2021-11-03 16:18:29 -0400
committerBrad King <brad.king@kitware.com>2021-11-03 16:18:29 -0400
commitd18ba5b2261530c72fb7ac6562dd261d009c9c3f (patch)
tree94fff8e422543ee6d91c35ea1d55b9b03344b47a
parent6202af6092bf6c2b9d3e303f694e9c64bbf56991 (diff)
parent001870d451d965a2cc4a30a89ed23e69bcd70b5e (diff)
downloadcmake-d18ba5b2261530c72fb7ac6562dd261d009c9c3f.tar.gz
Merge branch 'doc-TARGET_RUNTIME_DLLS' into release-3.21
Merge-request: !6700
-rw-r--r--Help/command/add_library.rst5
-rw-r--r--Help/manual/cmake-generator-expressions.7.rst11
2 files changed, 14 insertions, 2 deletions
diff --git a/Help/command/add_library.rst b/Help/command/add_library.rst
index dfc650091a..1235155deb 100644
--- a/Help/command/add_library.rst
+++ b/Help/command/add_library.rst
@@ -166,6 +166,8 @@ itself and is not included as a target in the generated buildsystem.
call are ``PRIVATE`` to the interface library and do not appear in its
:prop_tgt:`INTERFACE_SOURCES` target property.
+.. _`add_library imported libraries`:
+
Imported Libraries
^^^^^^^^^^^^^^^^^^
@@ -205,7 +207,8 @@ The ``<type>`` must be one of:
:prop_tgt:`IMPORTED_IMPLIB_<CONFIG>`) specifies the location of the
DLL import library file (``.lib`` or ``.dll.a``) on disk, and the
``IMPORTED_LOCATION`` is the location of the ``.dll`` runtime
- library (and is optional).
+ library (and is optional, but needed by the :genex:`TARGET_RUNTIME_DLLS`
+ generator expression).
Additional usage requirements may be specified in ``INTERFACE_*`` properties.
diff --git a/Help/manual/cmake-generator-expressions.7.rst b/Help/manual/cmake-generator-expressions.7.rst
index 5d508cb0dd..d3cbd491c2 100644
--- a/Help/manual/cmake-generator-expressions.7.rst
+++ b/Help/manual/cmake-generator-expressions.7.rst
@@ -1068,7 +1068,7 @@ which is just the string ``tgt``.
.. code-block:: cmake
- find_package(foo REQUIRED)
+ find_package(foo CONFIG REQUIRED) # package generated by install(EXPORT)
add_executable(exe main.c)
target_link_libraries(exe PRIVATE foo::foo foo::bar)
@@ -1077,6 +1077,15 @@ which is just the string ``tgt``.
COMMAND_EXPAND_LISTS
)
+ .. note::
+
+ :ref:`Imported Targets` are supported only if they know the location
+ of their ``.dll`` files. An imported ``SHARED`` or ``MODULE`` library
+ must have :prop_tgt:`IMPORTED_LOCATION` set to its ``.dll`` file. See
+ the :ref:`add_library imported libraries <add_library imported libraries>`
+ section for details. Many :ref:`Find Modules` produce imported targets
+ with the ``UNKNOWN`` type and therefore will be ignored.
+
.. genex:: $<INSTALL_PREFIX>
Content of the install prefix when the target is exported via