diff options
author | Kyle Edwards <kyle.edwards@kitware.com> | 2020-10-07 18:05:34 (GMT) |
---|---|---|
committer | Kyle Edwards <kyle.edwards@kitware.com> | 2020-10-13 13:46:54 (GMT) |
commit | fd50a75fa01b4727a58350b494dbb23f6b0f103f (patch) | |
tree | 6d4321f57bb2460e7ec76b6d5d76761b485b072c /Help/policy | |
parent | 521847809f4511352f01688227e8a22bc906f578 (diff) | |
download | CMake-fd50a75fa01b4727a58350b494dbb23f6b0f103f.zip CMake-fd50a75fa01b4727a58350b494dbb23f6b0f103f.tar.gz CMake-fd50a75fa01b4727a58350b494dbb23f6b0f103f.tar.bz2 |
CMP0115: Require source file extensions to be explicit
Diffstat (limited to 'Help/policy')
-rw-r--r-- | Help/policy/CMP0115.rst | 34 |
1 files changed, 34 insertions, 0 deletions
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 |