From 95cdce829f7c0ac3dbacb80c69004aea6a3d4d35 Mon Sep 17 00:00:00 2001 From: Craig Scott Date: Sun, 13 Mar 2022 20:31:08 +1100 Subject: Help: Fix typo and improve readability for LINK_LIBRARIES_ONLY_TARGETS --- Help/prop_tgt/LINK_LIBRARIES_ONLY_TARGETS.rst | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/Help/prop_tgt/LINK_LIBRARIES_ONLY_TARGETS.rst b/Help/prop_tgt/LINK_LIBRARIES_ONLY_TARGETS.rst index 78fbb02..a9af74d 100644 --- a/Help/prop_tgt/LINK_LIBRARIES_ONLY_TARGETS.rst +++ b/Help/prop_tgt/LINK_LIBRARIES_ONLY_TARGETS.rst @@ -20,17 +20,16 @@ This property is initialized by the value of the target is created. The property may be explicitly enabled on an imported target to check its link interface. -For example, the following code: +In the following example, CMake will halt with an error at configure time +because ``miLib`` is not a target: .. code-block:: cmake set(CMAKE_LINK_LIBRARIES_ONLY_TARGETS ON) - add_executable(myLib STATIC myLib.c) + add_library(myLib STATIC myLib.c) add_executable(myExe myExe.c) target_link_libraries(myExe PRIVATE miLib) # typo for myLib -will produce a CMake-time error that ``miLib`` is not a target. - In order to link toolchain-provided libraries by name while still enforcing ``LINK_LIBRARIES_ONLY_TARGETS``, use an :ref:`imported ` -- cgit v0.12