summaryrefslogtreecommitdiffstats
path: root/Help/command/target_sources.rst
diff options
context:
space:
mode:
authorCraig Scott <craig.scott@crascit.com>2022-07-20 10:19:37 (GMT)
committerCraig Scott <craig.scott@crascit.com>2022-07-20 10:19:37 (GMT)
commitc7c5a50b97583868456b1a152df35bc1e00e0e92 (patch)
tree10b466cfdc8f5802606b36c15ef422ce02580573 /Help/command/target_sources.rst
parenta47b203eeba852e68006be9ffa103bef148c14c6 (diff)
downloadCMake-c7c5a50b97583868456b1a152df35bc1e00e0e92.zip
CMake-c7c5a50b97583868456b1a152df35bc1e00e0e92.tar.gz
CMake-c7c5a50b97583868456b1a152df35bc1e00e0e92.tar.bz2
Help: Add missing PRIVATE keyword to target_sources() example
Fixes: #23746
Diffstat (limited to 'Help/command/target_sources.rst')
-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.