summaryrefslogtreecommitdiffstats
path: root/Help
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2022-09-27 14:28:30 (GMT)
committerKitware Robot <kwrobot@kitware.com>2022-09-27 14:28:49 (GMT)
commit50b668ddc833f7312cbd1140ddcca85ac46a1b2b (patch)
tree11555484691ac8b02741ba95451d6163af3128b4 /Help
parent954b861dba50b4f84c2a1e58e5bdf3f05179572b (diff)
parent2eb30a7036214ec960f0666163ff44ef754f6afe (diff)
downloadCMake-50b668ddc833f7312cbd1140ddcca85ac46a1b2b.zip
CMake-50b668ddc833f7312cbd1140ddcca85ac46a1b2b.tar.gz
CMake-50b668ddc833f7312cbd1140ddcca85ac46a1b2b.tar.bz2
Merge topic 'add_subdirectory_system'
2eb30a7036 add_subdirectory: Add SYSTEM option Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !7399
Diffstat (limited to 'Help')
-rw-r--r--Help/command/add_subdirectory.rst9
-rw-r--r--Help/manual/cmake-properties.7.rst1
-rw-r--r--Help/prop_dir/SYSTEM.rst10
-rw-r--r--Help/prop_tgt/SYSTEM.rst24
-rw-r--r--Help/release/dev/system.rst10
5 files changed, 44 insertions, 10 deletions
diff --git a/Help/command/add_subdirectory.rst b/Help/command/add_subdirectory.rst
index 8dba986..13cae10 100644
--- a/Help/command/add_subdirectory.rst
+++ b/Help/command/add_subdirectory.rst
@@ -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.
diff --git a/Help/manual/cmake-properties.7.rst b/Help/manual/cmake-properties.7.rst
index 09c3c88..ac89687 100644
--- a/Help/manual/cmake-properties.7.rst
+++ b/Help/manual/cmake-properties.7.rst
@@ -90,6 +90,7 @@ Properties on Directories
/prop_dir/RULE_LAUNCH_LINK
/prop_dir/SOURCE_DIR
/prop_dir/SUBDIRECTORIES
+ /prop_dir/SYSTEM
/prop_dir/TESTS
/prop_dir/TEST_INCLUDE_FILES
/prop_dir/VARIABLES
diff --git a/Help/prop_dir/SYSTEM.rst b/Help/prop_dir/SYSTEM.rst
new file mode 100644
index 0000000..4f923b7
--- /dev/null
+++ b/Help/prop_dir/SYSTEM.rst
@@ -0,0 +1,10 @@
+SYSTEM
+------
+
+.. versionadded:: 3.25
+
+This directory property is used to initialize the :prop_tgt:`SYSTEM`
+target property for targets created in that directory. It is set to
+true by :command:`add_subdirectory` and
+:command:`FetchContent_Declare` when the ``SYSTEM`` option is given
+as an argument to those commands.
diff --git a/Help/prop_tgt/SYSTEM.rst b/Help/prop_tgt/SYSTEM.rst
index 2db6aed..a267738 100644
--- a/Help/prop_tgt/SYSTEM.rst
+++ b/Help/prop_tgt/SYSTEM.rst
@@ -3,14 +3,20 @@ SYSTEM
.. versionadded:: 3.25
-Specifies that a target is a ``SYSTEM`` library. This has the following effects:
+Specifies that a target is a ``SYSTEM`` library. This has the following
+effects:
-* Entries of :prop_tgt:`INTERFACE_INCLUDE_DIRECTORIES` are treated as ``SYSTEM``
- include directories when compiling consumers.
- Entries of :prop_tgt:`INTERFACE_SYSTEM_INCLUDE_DIRECTORIES` are not affected,
- and will always be treated as ``SYSTEM`` include directories.
+* Entries of :prop_tgt:`INTERFACE_INCLUDE_DIRECTORIES` are treated as
+ ``SYSTEM`` include directories when compiling consumers.
+ Entries of :prop_tgt:`INTERFACE_SYSTEM_INCLUDE_DIRECTORIES` are not
+ affected, and will always be treated as ``SYSTEM`` include directories.
-For imported targets, this property has a default value `ON`, which means that their
-`INTERFACE_INCLUDE_DIRECTORIES` are treated as ``SYSTEM`` by default. If their
-`SYSTEM` property is `OFF`, then their `INTERFACE_INCLUDE_DIRECTORIES` will not be
-treated as ``SYSTEM``, regardless of the value of `IMPORTED_NO_SYSTEM` property.
+For imported targets, this property defaults to true, which means
+that their :prop_tgt:`INTERFACE_INCLUDE_DIRECTORIES` are treated
+as ``SYSTEM`` by default. If their ``SYSTEM`` property is false,
+then their :prop_tgt:`INTERFACE_INCLUDE_DIRECTORIES` will not be
+treated as ``SYSTEM``, regardless of the value of the
+:prop_tgt:`IMPORTED_NO_SYSTEM` property.
+
+This target property is initialized from the :prop_dir:`SYSTEM`
+directory property when the target is created.
diff --git a/Help/release/dev/system.rst b/Help/release/dev/system.rst
index 7cc841e..879e279 100644
--- a/Help/release/dev/system.rst
+++ b/Help/release/dev/system.rst
@@ -6,6 +6,16 @@ system
its include directories are automatically ``SYSTEM`` when
compiling consumers).
+* The :prop_dir:`SYSTEM` directory property was added to initialize the
+ :prop_tgt:`SYSTEM` target property for targets created in that directory.
+
+* The :command:`add_subdirectory` command gained a ``SYSTEM`` option
+ to enable the :prop_dir:`SYSTEM` directory property in the subdirectory.
+
+* The :module:`FetchContent` module :command:`FetchContent_Declare`
+ command gained a ``SYSTEM`` option to enable the :prop_dir:`SYSTEM`
+ directory property in the subdirectory.
+
* The :prop_tgt:`EXPORT_NO_SYSTEM` target property was added to
specify that :command:`install(EXPORT)` and :command:`export`
commands will generate a imported target with