summaryrefslogtreecommitdiffstats
path: root/Help
diff options
context:
space:
mode:
Diffstat (limited to 'Help')
-rw-r--r--Help/command/add_compile_options.rst3
-rw-r--r--Help/command/add_test.rst5
-rw-r--r--Help/command/get_property.rst10
-rw-r--r--Help/command/get_source_file_property.rst11
-rw-r--r--Help/command/set_property.rst13
-rw-r--r--Help/command/set_source_files_properties.rst13
-rw-r--r--Help/command/target_compile_options.rst2
-rw-r--r--Help/envvar/OBJC.rst14
-rw-r--r--Help/envvar/OBJCXX.rst14
-rw-r--r--Help/manual/cmake-env-variables.7.rst2
-rw-r--r--Help/prop_sf/COMPILE_OPTIONS.rst21
-rw-r--r--Help/prop_tgt/CUDA_STANDARD.rst2
-rw-r--r--Help/release/3.16.rst13
-rw-r--r--Help/release/3.17.rst4
-rw-r--r--Help/release/dev/FindPython-IronPython-support.rst5
-rw-r--r--Help/release/dev/cuda-clang.rst4
-rw-r--r--Help/release/dev/fetchcontent-SOURCE_SUBDIR.rst6
-rw-r--r--Help/release/dev/sf-property-scopes.rst15
18 files changed, 146 insertions, 11 deletions
diff --git a/Help/command/add_compile_options.rst b/Help/command/add_compile_options.rst
index 43805c3..36f403c 100644
--- a/Help/command/add_compile_options.rst
+++ b/Help/command/add_compile_options.rst
@@ -46,3 +46,6 @@ to use the more specific commands :command:`add_compile_definitions`
and :command:`include_directories`.
The command :command:`target_compile_options` adds target-specific options.
+
+The source file property :prop_sf:`COMPILE_OPTIONS` adds options to one
+source file.
diff --git a/Help/command/add_test.rst b/Help/command/add_test.rst
index a77ba37..c0677d2 100644
--- a/Help/command/add_test.rst
+++ b/Help/command/add_test.rst
@@ -10,8 +10,9 @@ Add a test to the project to be run by :manual:`ctest(1)`.
[WORKING_DIRECTORY <dir>]
[COMMAND_EXPAND_LISTS])
-Adds a test called ``<name>``. The test name may not contain spaces,
-quotes, or other characters special in CMake syntax. The options are:
+Adds a test called ``<name>``. The test name may contain arbitrary
+characters except for double-quotes. However, if it contains spaces
+or semicolons it must be enclosed in double-quotes. The options are:
``COMMAND``
Specify the test command-line. If ``<command>`` specifies an
diff --git a/Help/command/get_property.rst b/Help/command/get_property.rst
index c0f9b46..80d97fd 100644
--- a/Help/command/get_property.rst
+++ b/Help/command/get_property.rst
@@ -10,6 +10,7 @@ Get a property.
DIRECTORY [<dir>] |
TARGET <target> |
SOURCE <source> |
+ [<TARGET_DIRECTORY ... | DIRECTORY ...>] |
INSTALL <file> |
TEST <test> |
CACHE <entry> |
@@ -49,6 +50,15 @@ It must be one of the following:
``VARIABLE``
Scope is unique and does not accept a name.
+In the ``SOURCE`` case, the queried source file scope can be changed by
+specifying one of the additional options: ``DIRECTORY`` or ``TARGET_DIRECTORY``.
+
+``DIRECTORY`` takes a path to a processed directory, and the source file property
+will be read from that directory scope.
+
+``TARGET_DIRECTORY`` takes the name of an existing target. The source file
+property will be read from this target's directory scope.
+
The required ``PROPERTY`` option is immediately followed by the name of
the property to get. If the property is not set an empty value is
returned, although some properties support inheriting from a parent scope
diff --git a/Help/command/get_source_file_property.rst b/Help/command/get_source_file_property.rst
index decec19..893a1b6 100644
--- a/Help/command/get_source_file_property.rst
+++ b/Help/command/get_source_file_property.rst
@@ -5,7 +5,7 @@ Get a property for a source file.
.. code-block:: cmake
- get_source_file_property(VAR file property)
+ get_source_file_property(VAR file [<TARGET_DIRECTORY ... | DIRECTORY ...>] property)
Gets a property from a source file. The value of the property is
stored in the variable ``VAR``. If the source property is not found, the
@@ -15,6 +15,15 @@ or not (see :command:`define_property`). Non-inherited properties will set
parent scope as described for the :command:`define_property` command and
if still unable to find the property, ``VAR`` will be set to an empty string.
+The queried source file scope can be changed by specifying one of the
+additional options: ``DIRECTORY`` or ``TARGET_DIRECTORY``.
+
+``DIRECTORY`` takes a path to a processed directory, and the source file property
+will be read from that directory scope.
+
+``TARGET_DIRECTORY`` takes the name of an existing target. The source file
+property will be read from this target's directory scope.
+
Use :command:`set_source_files_properties` to set property values. Source
file properties usually control how the file is built. One property that is
always there is :prop_sf:`LOCATION`.
diff --git a/Help/command/set_property.rst b/Help/command/set_property.rst
index 1728c98..de28be3 100644
--- a/Help/command/set_property.rst
+++ b/Help/command/set_property.rst
@@ -8,7 +8,8 @@ Set a named property in a given scope.
set_property(<GLOBAL |
DIRECTORY [<dir>] |
TARGET [<target1> ...] |
- SOURCE [<src1> ...] |
+ SOURCE [<src1> ...]
+ [<TARGET_DIRECTORY ... | DIRECTORY ...>] |
INSTALL [<file1> ...] |
TEST [<test1> ...] |
CACHE [<entry1> ...] >
@@ -34,8 +35,16 @@ It must be one of the following:
``SOURCE``
Scope may name zero or more source files. Note that source
- file properties are visible only to targets added in the same
+ file properties are by default visible only to targets added in the same
directory (``CMakeLists.txt``).
+ The file properties can be made visible in a different directory by specifying
+ one of the additional options: ``TARGET_DIRECTORY`` or ``DIRECTORY``.
+
+ ``DIRECTORY`` takes a list of processed directories paths, and sets the file
+ properties in those directory scopes.
+
+ ``TARGET_DIRECTORY`` takes a list of existing targets. The file
+ properties will be set in these targets' directory scopes.
See also the :command:`set_source_files_properties` command.
``INSTALL``
diff --git a/Help/command/set_source_files_properties.rst b/Help/command/set_source_files_properties.rst
index ab95d70..8adfb9e 100644
--- a/Help/command/set_source_files_properties.rst
+++ b/Help/command/set_source_files_properties.rst
@@ -6,12 +6,25 @@ Source files can have properties that affect how they are built.
.. code-block:: cmake
set_source_files_properties([file1 [file2 [...]]]
+ [<TARGET_DIRECTORY ... | DIRECTORY ...>]
PROPERTIES prop1 value1
[prop2 value2 [...]])
Sets properties associated with source files using a key/value paired
list.
+Note that source file properties are by default visible only to
+targets added in the same directory (``CMakeLists.txt``).
+
+The file properties can be made visible in a different directory by specifying
+one of the additional options: ``TARGET_DIRECTORY`` or ``DIRECTORY``.
+
+``DIRECTORY`` takes a list of processed directories paths, and sets the file
+properties in those directory scopes.
+
+``TARGET_DIRECTORY`` takes a list of existing targets. The file
+properties will be set in these targets' directory scopes.
+
See also the :command:`set_property(SOURCE)` command.
See :ref:`Source File Properties` for the list of properties known
diff --git a/Help/command/target_compile_options.rst b/Help/command/target_compile_options.rst
index 47e7d86..3c733c5 100644
--- a/Help/command/target_compile_options.rst
+++ b/Help/command/target_compile_options.rst
@@ -46,3 +46,5 @@ to use the more specific commands :command:`target_compile_definitions`
and :command:`target_include_directories`.
For directory-wide settings, there is the command :command:`add_compile_options`.
+
+For file-specific settings, there is the source file property :prop_sf:`COMPILE_OPTIONS`.
diff --git a/Help/envvar/OBJC.rst b/Help/envvar/OBJC.rst
new file mode 100644
index 0000000..30c0d13
--- /dev/null
+++ b/Help/envvar/OBJC.rst
@@ -0,0 +1,14 @@
+OBJC
+----
+
+.. include:: ENV_VAR.txt
+
+Preferred executable for compiling ``OBJC`` language files. Will only be used
+by CMake on the first configuration to determine ``OBJC`` compiler, after
+which the value for ``OBJC`` is stored in the cache as
+:variable:`CMAKE_OBJC_COMPILER <CMAKE_<LANG>_COMPILER>`. For any configuration
+run (including the first), the environment variable will be ignored if the
+:variable:`CMAKE_OBJC_COMPILER <CMAKE_<LANG>_COMPILER>` variable is defined.
+
+If ``OBJC`` is not defined, the :envvar:`CC` environment variable will
+be checked instead.
diff --git a/Help/envvar/OBJCXX.rst b/Help/envvar/OBJCXX.rst
new file mode 100644
index 0000000..a72f7e7
--- /dev/null
+++ b/Help/envvar/OBJCXX.rst
@@ -0,0 +1,14 @@
+OBJCXX
+------
+
+.. include:: ENV_VAR.txt
+
+Preferred executable for compiling ``OBJCXX`` language files. Will only be used
+by CMake on the first configuration to determine ``OBJCXX`` compiler, after
+which the value for ``OBJCXX`` is stored in the cache as
+:variable:`CMAKE_OBJCXX_COMPILER <CMAKE_<LANG>_COMPILER>`. For any configuration
+run (including the first), the environment variable will be ignored if the
+:variable:`CMAKE_OBJCXX_COMPILER <CMAKE_<LANG>_COMPILER>` variable is defined.
+
+If ``OBJCXX`` is not defined, the :envvar:`CXX` environment variable will
+be checked instead.
diff --git a/Help/manual/cmake-env-variables.7.rst b/Help/manual/cmake-env-variables.7.rst
index ee83799..ce1e360 100644
--- a/Help/manual/cmake-env-variables.7.rst
+++ b/Help/manual/cmake-env-variables.7.rst
@@ -63,6 +63,8 @@ Environment Variables for Languages
/envvar/CXXFLAGS
/envvar/FC
/envvar/FFLAGS
+ /envvar/OBJC
+ /envvar/OBJCXX
/envvar/RC
/envvar/RCFLAGS
/envvar/SWIFTC
diff --git a/Help/prop_sf/COMPILE_OPTIONS.rst b/Help/prop_sf/COMPILE_OPTIONS.rst
index 7e48271..537dcec 100644
--- a/Help/prop_sf/COMPILE_OPTIONS.rst
+++ b/Help/prop_sf/COMPILE_OPTIONS.rst
@@ -5,9 +5,7 @@ List of additional options to pass to the compiler.
This property holds a :ref:`semicolon-separated list <CMake Language Lists>` of options
and will be added to the list of compile flags when this
-source file builds. Use :prop_sf:`COMPILE_DEFINITIONS` to pass
-additional preprocessor definitions and :prop_sf:`INCLUDE_DIRECTORIES` to pass
-additional include directories.
+source file builds.
Contents of ``COMPILE_OPTIONS`` may use "generator expressions" with the
syntax ``$<...>``. See the :manual:`cmake-generator-expressions(7)` manual
@@ -16,6 +14,19 @@ does not support per-config per-source settings, so expressions
that depend on the build configuration are not allowed with that
generator.
-.. note::
+Usage example:
- This property should be preferred over the :prop_sf:`COMPILE_FLAGS` property.
+.. code-block:: cmake
+
+ set_source_files_properties(foo.cpp PROPERTIES COMPILE_OPTIONS "-Wno-unused-parameter;-Wno-missing-field-initializer")
+
+Related properties:
+
+* Prefer this property over :prop_sf:`COMPILE_FLAGS`.
+* Use :prop_sf:`COMPILE_DEFINITIONS` to pass additional preprocessor definitions.
+* Use :prop_sf:`INCLUDE_DIRECTORIES` to pass additional include directories.
+
+Related commands:
+
+* :command:`add_compile_options` for directory-wide settings
+* :command:`target_compile_options` for target-specific settings
diff --git a/Help/prop_tgt/CUDA_STANDARD.rst b/Help/prop_tgt/CUDA_STANDARD.rst
index a3a2f56..6d6774e 100644
--- a/Help/prop_tgt/CUDA_STANDARD.rst
+++ b/Help/prop_tgt/CUDA_STANDARD.rst
@@ -7,7 +7,7 @@ This property specifies the CUDA/C++ standard whose features are requested
to build this target. For some compilers, this results in adding a
flag such as ``-std=gnu++11`` to the compile line.
-Supported values are ``98``, ``11``, ``14``.
+Supported values are ``98``, ``03``, ``11``, ``14``, ``17``, ``20``.
If the value requested does not result in a compile flag being added for
the compiler in use, a previous standard flag will be added instead. This
diff --git a/Help/release/3.16.rst b/Help/release/3.16.rst
index e2d6788..f3fdb08 100644
--- a/Help/release/3.16.rst
+++ b/Help/release/3.16.rst
@@ -303,3 +303,16 @@ Changes made since CMake 3.16.0 include the following.
Additionally, the modules no longer expose their internal ``_Python*``
cache entries publicly. CMake 3.16.0 through 3.16.4 accidentally
made them visible as advanced cache entries.
+
+3.16.7
+------
+
+* Selection of the Objective C or C++ compiler now considers the
+ :envvar:`CC` or :envvar:`CXX` environment variable if the
+ :envvar:`OBJC` or :envvar:`OBJCXX` environment variable is not set.
+
+* The :module:`FindPkgConfig` module now extracts include directories
+ prefixed with ``-isystem`` into the ``*_INCLUDE_DIRS`` variables and
+ :prop_tgt:`INTERFACE_INCLUDE_DIRECTORIES` target properties.
+ Previously they would be places in ``*_CFLAGS_OTHER`` variables and
+ :prop_tgt:`INTERFACE_COMPILE_OPTIONS` target properties.
diff --git a/Help/release/3.17.rst b/Help/release/3.17.rst
index 91e2463..b7c66d8 100644
--- a/Help/release/3.17.rst
+++ b/Help/release/3.17.rst
@@ -337,6 +337,10 @@ Changes made since CMake 3.17.0 include the following.
3.17.3
------
+* Selection of the Objective C or C++ compiler now considers the
+ :envvar:`CC` or :envvar:`CXX` environment variable if the
+ :envvar:`OBJC` or :envvar:`OBJCXX` environment variable is not set.
+
* The :module:`FindPkgConfig` module now extracts include directories
prefixed with ``-isystem`` into the ``*_INCLUDE_DIRS`` variables and
:prop_tgt:`INTERFACE_INCLUDE_DIRECTORIES` target properties.
diff --git a/Help/release/dev/FindPython-IronPython-support.rst b/Help/release/dev/FindPython-IronPython-support.rst
new file mode 100644
index 0000000..0ed11e9
--- /dev/null
+++ b/Help/release/dev/FindPython-IronPython-support.rst
@@ -0,0 +1,5 @@
+FindPython-IronPython-support
+-----------------------------
+
+* The :module:`FindPython3`, :module:`FindPython2` and :module:`FindPython`
+ modules support now the ``IronPython`` implementation on all platforms.
diff --git a/Help/release/dev/cuda-clang.rst b/Help/release/dev/cuda-clang.rst
new file mode 100644
index 0000000..fa5cd5a
--- /dev/null
+++ b/Help/release/dev/cuda-clang.rst
@@ -0,0 +1,4 @@
+cuda-clang
+----------
+
+* The ``CUDA`` language now supports Clang as a compiler.
diff --git a/Help/release/dev/fetchcontent-SOURCE_SUBDIR.rst b/Help/release/dev/fetchcontent-SOURCE_SUBDIR.rst
new file mode 100644
index 0000000..e9e185c
--- /dev/null
+++ b/Help/release/dev/fetchcontent-SOURCE_SUBDIR.rst
@@ -0,0 +1,6 @@
+fetchcontent-SOURCE_SUBDIR
+--------------------------
+
+* The :command:`FetchContent_Declare` command now supports a ``SOURCE_SUBDIR``
+ option. It can be used to direct :command:`FetchContent_MakeAvailable`
+ to look in a different location for the ``CMakeLists.txt`` file.
diff --git a/Help/release/dev/sf-property-scopes.rst b/Help/release/dev/sf-property-scopes.rst
new file mode 100644
index 0000000..0b61625
--- /dev/null
+++ b/Help/release/dev/sf-property-scopes.rst
@@ -0,0 +1,15 @@
+sf-property-scopes
+------------------
+
+* The :command:`set_property` with the ``SOURCE`` scope gained the
+ ``DIRECTORY`` and ``TARGET_DIRECTORY`` options to set properties
+ in the provided directory scopes.
+* The :command:`set_source_files_properties` gained the ``DIRECTORY``
+ and ``TARGET_DIRECTORY`` options to set properties in the provided
+ directory scopes.
+* The :command:`get_property` with ``SOURCE`` scope gained the
+ ``DIRECTORY`` and ``TARGET_DIRECTORY`` options to get a property
+ from the provided directory scope.
+* The :command:`get_source_file_property` gained the ``DIRECTORY``
+ and ``TARGET_DIRECTORY`` options to get a property from the
+ provided directory scope.