1CMP0115 2------- 3 4.. versionadded:: 3.20 5 6Source file extensions must be explicit. 7 8In CMake 3.19 and below, if a source file could not be found by the name 9specified, it would append a list of known extensions to the name to see if 10the file with the extension could be found. For example, this would allow the 11user to run: 12 13.. code-block:: cmake 14 15 add_executable(exe main) 16 17and put ``main.c`` in the executable without specifying the extension. 18 19Starting in CMake 3.20, CMake prefers all source files to have their extensions 20explicitly listed: 21 22.. code-block:: cmake 23 24 add_executable(exe main.c) 25 26The ``OLD`` behavior for this policy is to implicitly append known extensions 27to source files if they can't be found. The ``NEW`` behavior of this policy is 28to not append known extensions and require them to be explicit. 29 30This policy was introduced in CMake version 3.20. CMake version |release| 31warns when the policy is not set and uses ``OLD`` behavior. Use the 32:command:`cmake_policy` command to set it to ``OLD`` or ``NEW`` explicitly. 33 34.. include:: DEPRECATED.txt 35