add_subdirectory: Add SYSTEM option

Fixes: #22401
Signed-off-by: Da Quexian <daquexian566@gmail.com>
This commit is contained in:
Da Quexian
2022-06-22 20:18:06 +08:00
committed by Brad King
parent 80e4a155e0
commit 2eb30a7036
42 changed files with 199 additions and 18 deletions

View File

@@ -5,7 +5,7 @@ Add a subdirectory to the build.
.. code-block:: cmake
add_subdirectory(source_dir [binary_dir] [EXCLUDE_FROM_ALL])
add_subdirectory(source_dir [binary_dir] [EXCLUDE_FROM_ALL] [SYSTEM])
Adds a subdirectory to the build. The source_dir specifies the
directory in which the source CMakeLists.txt and code files are
@@ -33,3 +33,10 @@ dependencies supersede this exclusion. If a target built by the
parent project depends on a target in the subdirectory, the dependee
target will be included in the parent project build system to satisfy
the dependency.
If the ``SYSTEM`` argument is provided, the :prop_dir:`SYSTEM` directory
property of the subdirectory will be set to true. This property is
used to initialize the :prop_tgt:`SYSTEM` property of each target
created in that subdirectory. The include directories of targets with
:prop_tgt:`SYSTEM` set to true will be treated as ``SYSTEM`` when
compiling consumers.