diff options
Diffstat (limited to 'Help')
-rw-r--r-- | Help/manual/cmake-generator-expressions.7.rst | 18 | ||||
-rw-r--r-- | Help/manual/cmake-variables.7.rst | 8 | ||||
-rw-r--r-- | Help/prop_tgt/LINK_LIBRARY_OVERRIDE.rst | 8 | ||||
-rw-r--r-- | Help/prop_tgt/LINK_LIBRARY_OVERRIDE_LIBRARY.rst | 8 | ||||
-rw-r--r-- | Help/release/dev/Genex-LINK_LIBRARY.rst | 6 | ||||
-rw-r--r-- | Help/variable/CMAKE_LANG_LINK_LIBRARY_USING_FEATURE.rst (renamed from Help/variable/CMAKE_LANG_LINK_USING_FEATURE.rst) | 12 | ||||
-rw-r--r-- | Help/variable/CMAKE_LANG_LINK_LIBRARY_USING_FEATURE_SUPPORTED.rst | 13 | ||||
-rw-r--r-- | Help/variable/CMAKE_LANG_LINK_USING_FEATURE_SUPPORTED.rst | 13 | ||||
-rw-r--r-- | Help/variable/CMAKE_LINK_LIBRARY_USING_FEATURE.rst (renamed from Help/variable/CMAKE_LINK_USING_FEATURE.rst) | 15 | ||||
-rw-r--r-- | Help/variable/CMAKE_LINK_LIBRARY_USING_FEATURE.txt (renamed from Help/variable/CMAKE_LINK_USING_FEATURE.txt) | 27 | ||||
-rw-r--r-- | Help/variable/CMAKE_LINK_LIBRARY_USING_FEATURE_SUPPORTED.rst | 14 | ||||
-rw-r--r-- | Help/variable/CMAKE_LINK_USING_FEATURE_SUPPORTED.rst | 14 | ||||
-rw-r--r-- | Help/variable/LINK_LIBRARY_PREDEFINED_FEATURES.txt | 8 |
13 files changed, 84 insertions, 80 deletions
diff --git a/Help/manual/cmake-generator-expressions.7.rst b/Help/manual/cmake-generator-expressions.7.rst index 7c34671..0e9060d 100644 --- a/Help/manual/cmake-generator-expressions.7.rst +++ b/Help/manual/cmake-generator-expressions.7.rst @@ -1125,23 +1125,23 @@ Output-Related Expressions add_library(lib1 STATIC ...) add_library(lib2 ...) - target_link_libraries(lib2 PRIVATE $<LINK_LIBRARY:whole_archive,lib1>) + target_link_libraries(lib2 PRIVATE "$<LINK_LIBRARY:whole_archive,lib1>") This specify to use the ``lib1`` target with feature ``whole_archive`` for linking target ``lib2``. The feature must have be defined by - :variable:`CMAKE_<LANG>_LINK_USING_<FEATURE>` variable or, if - :variable:`CMAKE_<LANG>_LINK_USING_<FEATURE>_SUPPORTED` is false, - by :variable:`CMAKE_LINK_USING_<FEATURE>` variable. + :variable:`CMAKE_<LANG>_LINK_LIBRARY_USING_<FEATURE>` variable or, if + :variable:`CMAKE_<LANG>_LINK_LIBRARY_USING_<FEATURE>_SUPPORTED` is false, + by :variable:`CMAKE_LINK_LIBRARY_USING_<FEATURE>` variable. .. note:: The evaluation of this generator expression will use, for the following variables, the values defined at the level of the creation of the target: - * :variable:`CMAKE_<LANG>_LINK_USING_<FEATURE>_SUPPORTED` - * :variable:`CMAKE_<LANG>_LINK_USING_<FEATURE>` - * :variable:`CMAKE_LINK_USING_<FEATURE>_SUPPORTED` - * :variable:`CMAKE_LINK_USING_<FEATURE>` + * :variable:`CMAKE_<LANG>_LINK_LIBRARY_USING_<FEATURE>_SUPPORTED` + * :variable:`CMAKE_<LANG>_LINK_LIBRARY_USING_<FEATURE>` + * :variable:`CMAKE_LINK_LIBRARY_USING_<FEATURE>_SUPPORTED` + * :variable:`CMAKE_LINK_LIBRARY_USING_<FEATURE>` This expression can only be used to specify link libraries (i.e. part of :command:`link_libraries` or :command:`target_link_libraries` commands and @@ -1170,7 +1170,7 @@ Output-Related Expressions add_library(lib1 ...) add_library(lib2 ...) - target_link_libraries(lib2 PUBLIC $<LINK_LIBRARY:feature1,lib1>) + target_link_libraries(lib2 PUBLIC "$<LINK_LIBRARY:feature1,lib1>") add_library(lib3 ...) target_link_libraries(lib3 PRIVATE lib1 lib2) diff --git a/Help/manual/cmake-variables.7.rst b/Help/manual/cmake-variables.7.rst index 5db622c..b38f56c 100644 --- a/Help/manual/cmake-variables.7.rst +++ b/Help/manual/cmake-variables.7.rst @@ -437,11 +437,11 @@ Variables that Control the Build /variable/CMAKE_LANG_CPPCHECK /variable/CMAKE_LANG_CPPLINT /variable/CMAKE_LANG_INCLUDE_WHAT_YOU_USE + /variable/CMAKE_LANG_LINK_LIBRARY_USING_FEATURE + /variable/CMAKE_LANG_LINK_LIBRARY_USING_FEATURE_SUPPORTED /variable/CMAKE_LANG_LINKER_LAUNCHER /variable/CMAKE_LANG_LINK_LIBRARY_FILE_FLAG /variable/CMAKE_LANG_LINK_LIBRARY_FLAG - /variable/CMAKE_LANG_LINK_USING_FEATURE - /variable/CMAKE_LANG_LINK_USING_FEATURE_SUPPORTED /variable/CMAKE_LANG_LINK_WHAT_YOU_USE_FLAG /variable/CMAKE_LANG_VISIBILITY_PRESET /variable/CMAKE_LIBRARY_OUTPUT_DIRECTORY @@ -452,8 +452,8 @@ Variables that Control the Build /variable/CMAKE_LINK_INTERFACE_LIBRARIES /variable/CMAKE_LINK_LIBRARY_FILE_FLAG /variable/CMAKE_LINK_LIBRARY_FLAG - /variable/CMAKE_LINK_USING_FEATURE - /variable/CMAKE_LINK_USING_FEATURE_SUPPORTED + /variable/CMAKE_LINK_LIBRARY_USING_FEATURE + /variable/CMAKE_LINK_LIBRARY_USING_FEATURE_SUPPORTED /variable/CMAKE_LINK_WHAT_YOU_USE /variable/CMAKE_LINK_WHAT_YOU_USE_CHECK /variable/CMAKE_MACOSX_BUNDLE diff --git a/Help/prop_tgt/LINK_LIBRARY_OVERRIDE.rst b/Help/prop_tgt/LINK_LIBRARY_OVERRIDE.rst index e9c76b0..81a2a4a 100644 --- a/Help/prop_tgt/LINK_LIBRARY_OVERRIDE.rst +++ b/Help/prop_tgt/LINK_LIBRARY_OVERRIDE.rst @@ -22,10 +22,10 @@ example: .. code-block:: cmake add_library(lib1 ...) - target_link_libraries(lib1 PUBLIC $<LINK_LIBRARY:feature1,external>) + target_link_libraries(lib1 PUBLIC "$<LINK_LIBRARY:feature1,external>") add_library(lib2 ...) - target_link_libraries(lib2 PUBLIC $<LINK_LIBRARY:feature2,lib1>) + target_link_libraries(lib2 PUBLIC "$<LINK_LIBRARY:feature2,lib1>") add_library(lib3 ...) target_link_libraries(lib3 PRIVATE lib1 lib2) @@ -50,5 +50,5 @@ See also :prop_tgt:`LINK_LIBRARY_OVERRIDE_<LIBRARY>` target property for a per linked target oriented approach to override features. For more information about features, see -:variable:`CMAKE_<LANG>_LINK_USING_<FEATURE>` -and :variable:`CMAKE_LINK_USING_<FEATURE>` variables. +:variable:`CMAKE_<LANG>_LINK_LIBRARY_USING_<FEATURE>` +and :variable:`CMAKE_LINK_LIBRARY_USING_<FEATURE>` variables. diff --git a/Help/prop_tgt/LINK_LIBRARY_OVERRIDE_LIBRARY.rst b/Help/prop_tgt/LINK_LIBRARY_OVERRIDE_LIBRARY.rst index 58141c9..112f614 100644 --- a/Help/prop_tgt/LINK_LIBRARY_OVERRIDE_LIBRARY.rst +++ b/Help/prop_tgt/LINK_LIBRARY_OVERRIDE_LIBRARY.rst @@ -14,10 +14,10 @@ This property takes a ``feature`` name which will be applied to the .. code-block:: cmake add_library(lib1 ...) - target_link_libraries(lib1 PUBLIC $<LINK_LIBRARY:feature1,external>) + target_link_libraries(lib1 PUBLIC "$<LINK_LIBRARY:feature1,external>") add_library(lib2 ...) - target_link_libraries(lib2 PUBLIC $<LINK_LIBRARY:feature2,lib1>) + target_link_libraries(lib2 PUBLIC "$<LINK_LIBRARY:feature2,lib1>") add_library(lib3 ...) target_link_libraries(lib3 PRIVATE lib1 lib2) @@ -41,5 +41,5 @@ This property takes precedence over :prop_tgt:`LINK_LIBRARY_OVERRIDE` target property. For more information about features, see -:variable:`CMAKE_<LANG>_LINK_USING_<FEATURE>` -and :variable:`CMAKE_LINK_USING_<FEATURE>` variables. +:variable:`CMAKE_<LANG>_LINK_LIBRARY_USING_<FEATURE>` +and :variable:`CMAKE_LINK_LIBRARY_USING_<FEATURE>` variables. diff --git a/Help/release/dev/Genex-LINK_LIBRARY.rst b/Help/release/dev/Genex-LINK_LIBRARY.rst index 3234acb..fe44dbc 100644 --- a/Help/release/dev/Genex-LINK_LIBRARY.rst +++ b/Help/release/dev/Genex-LINK_LIBRARY.rst @@ -3,9 +3,9 @@ Genex-LINK_LIBRARY * The :genex:`LINK_LIBRARY` generator expression was added to manage how libraries are specified during the link step. The variables - :variable:`CMAKE_<LANG>_LINK_USING_<FEATURE>` and - :variable:`CMAKE_LINK_USING_<FEATURE>` are used to define features usable by - the :genex:`LINK_LIBRARY` generator expression. Moreover, the + :variable:`CMAKE_<LANG>_LINK_LIBRARY_USING_<FEATURE>` and + :variable:`CMAKE_LINK_LIBRARY_USING_<FEATURE>` are used to define features + usable by the :genex:`LINK_LIBRARY` generator expression. Moreover, the :prop_tgt:`LINK_LIBRARY_OVERRIDE` and :prop_tgt:`LINK_LIBRARY_OVERRIDE_<LIBRARY>` target properties are available to resolve incompatible features. diff --git a/Help/variable/CMAKE_LANG_LINK_USING_FEATURE.rst b/Help/variable/CMAKE_LANG_LINK_LIBRARY_USING_FEATURE.rst index 9d7f87a..45b8aa8 100644 --- a/Help/variable/CMAKE_LANG_LINK_USING_FEATURE.rst +++ b/Help/variable/CMAKE_LANG_LINK_LIBRARY_USING_FEATURE.rst @@ -1,5 +1,5 @@ -CMAKE_<LANG>_LINK_USING_<FEATURE> ---------------------------------- +CMAKE_<LANG>_LINK_LIBRARY_USING_<FEATURE> +----------------------------------------- .. versionadded:: 3.24 @@ -12,11 +12,11 @@ using :genex:`LINK_LIBRARY` generator expression. Feature names defined in all uppercase are reserved to CMake. See also the associated variable -:variable:`CMAKE_<LANG>_LINK_USING_<FEATURE>_SUPPORTED` and -:variable:`CMAKE_LINK_USING_<FEATURE>` variable for the definition of features -independent from the link language. +:variable:`CMAKE_<LANG>_LINK_LIBRARY_USING_<FEATURE>_SUPPORTED` and +:variable:`CMAKE_LINK_LIBRARY_USING_<FEATURE>` variable for the definition of +features independent from the link language. -.. include:: CMAKE_LINK_USING_FEATURE.txt +.. include:: CMAKE_LINK_LIBRARY_USING_FEATURE.txt Predefined Features ^^^^^^^^^^^^^^^^^^^ diff --git a/Help/variable/CMAKE_LANG_LINK_LIBRARY_USING_FEATURE_SUPPORTED.rst b/Help/variable/CMAKE_LANG_LINK_LIBRARY_USING_FEATURE_SUPPORTED.rst new file mode 100644 index 0000000..e595bc7 --- /dev/null +++ b/Help/variable/CMAKE_LANG_LINK_LIBRARY_USING_FEATURE_SUPPORTED.rst @@ -0,0 +1,13 @@ +CMAKE_<LANG>_LINK_LIBRARY_USING_<FEATURE>_SUPPORTED +--------------------------------------------------- + +.. versionadded:: 3.24 + +Set to ``TRUE`` if the ``<FEATURE>``, as defined by variable +:variable:`CMAKE_<LANG>_LINK_LIBRARY_USING_<FEATURE>`, is supported for the +linker language ``<LANG>``. + +.. note:: + + This variable is evaluated before the more generic variable + :variable:`CMAKE_LINK_LIBRARY_USING_<FEATURE>_SUPPORTED`. diff --git a/Help/variable/CMAKE_LANG_LINK_USING_FEATURE_SUPPORTED.rst b/Help/variable/CMAKE_LANG_LINK_USING_FEATURE_SUPPORTED.rst deleted file mode 100644 index 5794b15..0000000 --- a/Help/variable/CMAKE_LANG_LINK_USING_FEATURE_SUPPORTED.rst +++ /dev/null @@ -1,13 +0,0 @@ -CMAKE_<LANG>_LINK_USING_<FEATURE>_SUPPORTED -------------------------------------------- - -.. versionadded:: 3.24 - -Set to ``TRUE`` if the ``<FEATURE>``, as defined by variable -:variable:`CMAKE_<LANG>_LINK_USING_<FEATURE>`, is supported for the linker -language ``<LANG>``. - -.. note:: - - This variable is evaluated before the more generic variable - :variable:`CMAKE_LINK_USING_<FEATURE>_SUPPORTED`. diff --git a/Help/variable/CMAKE_LINK_USING_FEATURE.rst b/Help/variable/CMAKE_LINK_LIBRARY_USING_FEATURE.rst index 0c9cadc..eae60c5 100644 --- a/Help/variable/CMAKE_LINK_USING_FEATURE.rst +++ b/Help/variable/CMAKE_LINK_LIBRARY_USING_FEATURE.rst @@ -1,5 +1,5 @@ -CMAKE_LINK_USING_<FEATURE> --------------------------- +CMAKE_LINK_LIBRARY_USING_<FEATURE> +---------------------------------- .. versionadded:: 3.24 @@ -12,15 +12,16 @@ using :genex:`LINK_LIBRARY` generator expression. Feature names defined in all uppercase are reserved to CMake. See also the associated variable -:variable:`CMAKE_LINK_USING_<FEATURE>_SUPPORTED` and -:variable:`CMAKE_<LANG>_LINK_USING_<FEATURE>` variable for the definition of -features dependent from the link language. +:variable:`CMAKE_LINK_LIBRARY_USING_<FEATURE>_SUPPORTED` and +:variable:`CMAKE_<LANG>_LINK_LIBRARY_USING_<FEATURE>` variable for the +definition of features dependent from the link language. This variable will be used by :genex:`LINK_LIBRARY` generator expression if, for the linker language, the variable -:variable:`CMAKE_<LANG>_LINK_USING_<FEATURE>_SUPPORTED` is false or not set. +:variable:`CMAKE_<LANG>_LINK_LIBRARY_USING_<FEATURE>_SUPPORTED` is false or not +set. -.. include:: CMAKE_LINK_USING_FEATURE.txt +.. include:: CMAKE_LINK_LIBRARY_USING_FEATURE.txt Predefined Features ^^^^^^^^^^^^^^^^^^^ diff --git a/Help/variable/CMAKE_LINK_USING_FEATURE.txt b/Help/variable/CMAKE_LINK_LIBRARY_USING_FEATURE.txt index 92fc92d..ad393b0 100644 --- a/Help/variable/CMAKE_LINK_USING_FEATURE.txt +++ b/Help/variable/CMAKE_LINK_LIBRARY_USING_FEATURE.txt @@ -46,27 +46,27 @@ is offered by various environments but with a specific syntax: .. code-block:: cmake - set(CMAKE_C_LINK_USING_whole_archive_SUPPORTED TRUE) + set(CMAKE_C_LINK_LIBRARY_USING_whole_archive_SUPPORTED TRUE) if(CMAKE_C_COMPILER_ID STREQUAL "AppleClang") - set(CMAKE_C_LINK_USING_whole_archive "-force_load <LIB_ITEM>") + set(CMAKE_C_LINK_LIBRARY_USING_whole_archive "-force_load <LIB_ITEM>") elseif(CMAKE_C_COMPILER_ID STREQUAL "GNU" AND CMAKE_SYSTEM_NAME STREQUAL "Linux") - set(CMAKE_C_LINK_USING_whole_archive "LINKER:--push-state,--whole-archive" - "<LINK_ITEM>" - "LINKER:--pop-state") + set(CMAKE_C_LINK_LIBRARY_USING_whole_archive "LINKER:--push-state,--whole-archive" + "<LINK_ITEM>" + "LINKER:--pop-state") elseif(CMAKE_C_COMPILER_ID STREQUAL "MSVC") - set(CMAKE_C_LINK_USING_whole_archive "/WHOLEARCHIVE:<LIBRARY>") + set(CMAKE_C_LINK_LIBRARY_USING_whole_archive "/WHOLEARCHIVE:<LIBRARY>") else() # feature not yet supported for the other environments - set(CMAKE_C_LINK_USING_whole_archive_SUPPORTED FALSE) + set(CMAKE_C_LINK_LIBRARY_USING_whole_archive_SUPPORTED FALSE) endif() add_library(lib1 STATIC ...) add_library(lib2 SHARED ...) - if(CMAKE_C_LINK_USING_whole_archive_SUPPORTED) + if(CMAKE_C_LINK_LIBRARY_USING_whole_archive_SUPPORTED) target_link_libraries(lib2 PRIVATE - $<LINK_LIBRARY:whole_archive,lib1,$<IF:$<LINK_LANG_AND_ID:C,Clang>,libexternal.a,external>>) + "$<LINK_LIBRARY:whole_archive,lib1,$<IF:$<LINK_LANG_AND_ID:C,Clang>,libexternal.a,external>>") else() target_link_libraries(lib2 PRIVATE lib1 external) endif() @@ -95,14 +95,15 @@ library specified by path and by name. This constraint by be solved by using .. code-block:: cmake if (CMAKE_C_COMPILER_ID STREQUAL "AppleClang") - set(CMAKE_LINK_USING_weak_library "PATH{-weak_library <LIBRARY>}NAME{LINKER:-weak-l<LIB_ITEM>}") - set(CMAKE_LINK_USING_weak_library_SUPPORTED TRUE) + set(CMAKE_LINK_LIBRARY_USING_weak_library + "PATH{-weak_library <LIBRARY>}NAME{LINKER:-weak-l<LIB_ITEM>}") + set(CMAKE_LINK_LIBRARY_USING_weak_library_SUPPORTED TRUE) endif() add_library(lib SHARED ...) add_executable(main ...) - if(CMAKE_LINK_USING_weak_library_SUPPORTED) - target_link_libraries(main PRIVATE $<LINK_LIBRARY:weak_library,lib,external>) + if(CMAKE_LINK_LIBRARY_USING_weak_library_SUPPORTED) + target_link_libraries(main PRIVATE "$<LINK_LIBRARY:weak_library,lib,external>") else() target_link_libraries(main PRIVATE lib external) endif() diff --git a/Help/variable/CMAKE_LINK_LIBRARY_USING_FEATURE_SUPPORTED.rst b/Help/variable/CMAKE_LINK_LIBRARY_USING_FEATURE_SUPPORTED.rst new file mode 100644 index 0000000..42b75fc --- /dev/null +++ b/Help/variable/CMAKE_LINK_LIBRARY_USING_FEATURE_SUPPORTED.rst @@ -0,0 +1,14 @@ +CMAKE_LINK_LIBRARY_USING_<FEATURE>_SUPPORTED +-------------------------------------------- + +.. versionadded:: 3.24 + +Set to ``TRUE`` if the ``<FEATURE>``, as defined by variable +:variable:`CMAKE_LINK_LIBRARY_USING_<FEATURE>`, is supported regardless the +linker language. + +.. note:: + + This variable is evaluated if, and only if, the variable + :variable:`CMAKE_<LANG>_LINK_LIBRARY_USING_<FEATURE>_SUPPORTED` evaluates to + ``FALSE``. diff --git a/Help/variable/CMAKE_LINK_USING_FEATURE_SUPPORTED.rst b/Help/variable/CMAKE_LINK_USING_FEATURE_SUPPORTED.rst deleted file mode 100644 index 31c3108..0000000 --- a/Help/variable/CMAKE_LINK_USING_FEATURE_SUPPORTED.rst +++ /dev/null @@ -1,14 +0,0 @@ -CMAKE_LINK_USING_<FEATURE>_SUPPORTED ------------------------------------- - -.. versionadded:: 3.24 - -Set to ``TRUE`` if the ``<FEATURE>``, as defined by variable -:variable:`CMAKE_LINK_USING_<FEATURE>`, is supported regardless the linker -language. - -.. note:: - - This variable is evaluated if, and only if, the variable - :variable:`CMAKE_<LANG>_LINK_USING_<FEATURE>_SUPPORTED` evaluates to - ``FALSE``. diff --git a/Help/variable/LINK_LIBRARY_PREDEFINED_FEATURES.txt b/Help/variable/LINK_LIBRARY_PREDEFINED_FEATURES.txt index d4fdf76..82c406a 100644 --- a/Help/variable/LINK_LIBRARY_PREDEFINED_FEATURES.txt +++ b/Help/variable/LINK_LIBRARY_PREDEFINED_FEATURES.txt @@ -23,9 +23,11 @@ compatible with it. linker option ``-weak_framework``). Features for framework linking have a special handling in ``CMake``: the -framework can be specified as a ``CMake`` framework target or file path. In -the later case, if the path includes a directory part, this one will be -specified as framework search path at link step. +framework can be specified as a ``CMake`` framework target or file path. In the +first case, the target must have the :prop_tgt:`FRAMEWORK` target property set +as ``TRUE`` to enable framework handling. In the later case, if the path +includes a directory part, this one will be specified as framework search path +at link step. .. code-block:: cmake |