diff options
Diffstat (limited to 'Help')
-rw-r--r-- | Help/command/add_subdirectory.rst | 9 | ||||
-rw-r--r-- | Help/manual/cmake-properties.7.rst | 1 | ||||
-rw-r--r-- | Help/prop_dir/SYSTEM.rst | 10 | ||||
-rw-r--r-- | Help/prop_tgt/SYSTEM.rst | 24 | ||||
-rw-r--r-- | Help/release/dev/system.rst | 10 |
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 9fb46be..fde1dd0 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 |