summaryrefslogtreecommitdiffstats
path: root/Help
diff options
context:
space:
mode:
authorKyle Edwards <kyle.edwards@kitware.com>2020-10-13 14:17:03 (GMT)
committerKitware Robot <kwrobot@kitware.com>2020-10-13 14:17:14 (GMT)
commita1988e4c80a7c75f216814c5827796e976c25605 (patch)
tree507591a4f1ecc659a57975568776231c7f2a3d36 /Help
parent3b9150f3603418312ce5000d31e1b1ab8228869d (diff)
parentfd50a75fa01b4727a58350b494dbb23f6b0f103f (diff)
downloadCMake-a1988e4c80a7c75f216814c5827796e976c25605.zip
CMake-a1988e4c80a7c75f216814c5827796e976c25605.tar.gz
CMake-a1988e4c80a7c75f216814c5827796e976c25605.tar.bz2
Merge topic 'explicit-source-extensions'
fd50a75fa0 CMP0115: Require source file extensions to be explicit Acked-by: Kitware Robot <kwrobot@kitware.com> Acked-by: Ben Boeckel <ben.boeckel@kitware.com> Merge-request: !5346
Diffstat (limited to 'Help')
-rw-r--r--Help/manual/cmake-policies.7.rst8
-rw-r--r--Help/policy/CMP0115.rst34
-rw-r--r--Help/release/dev/explicit-source-extensions.rst5
3 files changed, 47 insertions, 0 deletions
diff --git a/Help/manual/cmake-policies.7.rst b/Help/manual/cmake-policies.7.rst
index 0392325..0836883 100644
--- a/Help/manual/cmake-policies.7.rst
+++ b/Help/manual/cmake-policies.7.rst
@@ -51,6 +51,14 @@ The :variable:`CMAKE_MINIMUM_REQUIRED_VERSION` variable may also be used
to determine whether to report an error on use of deprecated macros or
functions.
+Policies Introduced by CMake 3.20
+=================================
+
+.. toctree::
+ :maxdepth: 1
+
+ CMP0115: Source file extensions must be explicit. </policy/CMP0115>
+
Policies Introduced by CMake 3.19
=================================
diff --git a/Help/policy/CMP0115.rst b/Help/policy/CMP0115.rst
new file mode 100644
index 0000000..7f82c43
--- /dev/null
+++ b/Help/policy/CMP0115.rst
@@ -0,0 +1,34 @@
+CMP0115
+-------
+
+.. versionadded:: 3.20
+
+Source file extensions must be explicit.
+
+In CMake 3.19 and below, if a source file could not be found by the name
+specified, it would append a list of known extensions to the name to see if
+the file with the extension could be found. For example, this would allow the
+user to run:
+
+.. code-block:: cmake
+
+ add_executable(exe main)
+
+and put ``main.c`` in the executable without specifying the extension.
+
+Starting in CMake 3.20, CMake prefers all source files to have their extensions
+explicitly listed:
+
+.. code-block:: cmake
+
+ add_executable(exe main.c)
+
+The ``OLD`` behavior for this policy is to implicitly append known extensions
+to source files if they can't be found. The ``NEW`` behavior of this policy is
+to not append known extensions and require them to be explicit.
+
+This policy was introduced in CMake version 3.20. CMake version |release|
+warns when the policy is not set and uses ``OLD`` behavior. Use the
+:command:`cmake_policy` command to set it to ``OLD`` or ``NEW`` explicitly.
+
+.. include:: DEPRECATED.txt
diff --git a/Help/release/dev/explicit-source-extensions.rst b/Help/release/dev/explicit-source-extensions.rst
new file mode 100644
index 0000000..ccd9339
--- /dev/null
+++ b/Help/release/dev/explicit-source-extensions.rst
@@ -0,0 +1,5 @@
+explicit-source-extensions
+--------------------------
+
+* Source file extensions must now be explicit. See policy :policy:`CMP0115` for
+ details.