From 0723c36ffc455bdfa160ca9ca74ae466349aaecf Mon Sep 17 00:00:00 2001 From: Peter Kokot Date: Mon, 26 May 2025 00:51:46 +0200 Subject: [PATCH] CMakeExpandImportedTargets: Sync documentation - Added intro code block showing how to include this module. - Used word "command" instead of "function". --- Modules/CMakeExpandImportedTargets.cmake | 25 ++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/Modules/CMakeExpandImportedTargets.cmake b/Modules/CMakeExpandImportedTargets.cmake index 64561e86d7..e9e04f65ad 100644 --- a/Modules/CMakeExpandImportedTargets.cmake +++ b/Modules/CMakeExpandImportedTargets.cmake @@ -16,6 +16,12 @@ CMakeExpandImportedTargets :command:`try_compile` command and since CMake 3.2 for :command:`try_run` command). +Load this module in a CMake project with: + +.. code-block:: cmake + + include(CMakeExpandImportedTargets) + .. note:: This module does not support the policy :policy:`CMP0022` ``NEW`` behavior, @@ -23,13 +29,17 @@ CMakeExpandImportedTargets :manual:`generator expressions ` cannot be evaluated at the configuration phase. -Functions +Commands ^^^^^^^^^ -This module defines the following function: +This module provides the following command: .. command:: cmake_expand_imported_targets + Expands all imported targets in a given list of libraries to their + corresponding file paths on disk and stores the resulting list in a local + variable: + .. code-block:: cmake cmake_expand_imported_targets( @@ -38,19 +48,18 @@ This module defines the following function: [CONFIGURATION ] ) - Expands all imported targets in a list of libraries ``...`` to their - corresponding file paths on disk and stores the resulting list in a local - variable ````. + The arguments are: - The options are: + ```` + Name of a CMake variable containing the resulting list of file paths. - ``LIBRARIES`` + ``LIBRARIES ...`` A :ref:`semicolon-separated list ` of system and imported targets. Imported targets in this list are replaced with their corresponding library file paths, including libraries from their link interfaces. - ``CONFIGURATION`` + ``CONFIGURATION `` If this option is given, it uses the respective build configuration ```` of the imported targets if it exists. If omitted, it defaults to the first entry in the :variable:`CMAKE_CONFIGURATION_TYPES` variable, or