Files
CMake/Help/policy/CMP0115.rst
Brad King ad3c2c0b03 Help: Normalize and consolidate standard policy advice paragraph
Every policy's documentation has a paragraph on what version of CMake
introduced it, how to set the policy, and whether CMake warns if the
policy is not set.  The wording of this paragraph has diverged across
policies over time.  Factor the paragraph out into a standard advice
document included by every policy.
2024-01-11 14:48:01 -05:00

35 lines
976 B
ReStructuredText

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.
.. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.20
.. |WARNS_OR_DOES_NOT_WARN| replace:: warns
.. include:: STANDARD_ADVICE.txt
.. include:: DEPRECATED.txt