summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2022-07-20 12:45:46 (GMT)
committerKitware Robot <kwrobot@kitware.com>2022-07-20 12:45:53 (GMT)
commitde8df25a20509d4c18bfafe5081856b648bfb1ad (patch)
tree36e911668921963e9f2f6b956f38ef8a84deec6b
parentd6db6ffae8978aa50bc72424c9ae62603b896373 (diff)
parentc7c5a50b97583868456b1a152df35bc1e00e0e92 (diff)
downloadCMake-de8df25a20509d4c18bfafe5081856b648bfb1ad.zip
CMake-de8df25a20509d4c18bfafe5081856b648bfb1ad.tar.gz
CMake-de8df25a20509d4c18bfafe5081856b648bfb1ad.tar.bz2
Merge topic 'doc-example-target-sources' into release-3.24
c7c5a50b97 Help: Add missing PRIVATE keyword to target_sources() example Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !7490
-rw-r--r--Help/command/target_sources.rst4
1 files changed, 2 insertions, 2 deletions
diff --git a/Help/command/target_sources.rst b/Help/command/target_sources.rst
index 1ad6c37..72119f6 100644
--- a/Help/command/target_sources.rst
+++ b/Help/command/target_sources.rst
@@ -52,10 +52,10 @@ expressions to ensure the sources are correctly assigned to the target.
.. code-block:: cmake
# WRONG: starts with generator expression, but relative path used
- target_sources(MyTarget "$<$<CONFIG:Debug>:dbgsrc.cpp>")
+ target_sources(MyTarget PRIVATE "$<$<CONFIG:Debug>:dbgsrc.cpp>")
# CORRECT: absolute path used inside the generator expression
- target_sources(MyTarget "$<$<CONFIG:Debug>:${CMAKE_CURRENT_SOURCE_DIR}/dbgsrc.cpp>")
+ target_sources(MyTarget PRIVATE "$<$<CONFIG:Debug>:${CMAKE_CURRENT_SOURCE_DIR}/dbgsrc.cpp>")
See the :manual:`cmake-buildsystem(7)` manual for more on defining
buildsystem properties.