CMP0115.rst 976 B

12345678910111213141516171819202122232425262728293031323334
  1. CMP0115
  2. -------
  3. .. versionadded:: 3.20
  4. Source file extensions must be explicit.
  5. In CMake 3.19 and below, if a source file could not be found by the name
  6. specified, it would append a list of known extensions to the name to see if
  7. the file with the extension could be found. For example, this would allow the
  8. user to run:
  9. .. code-block:: cmake
  10. add_executable(exe main)
  11. and put ``main.c`` in the executable without specifying the extension.
  12. Starting in CMake 3.20, CMake prefers all source files to have their extensions
  13. explicitly listed:
  14. .. code-block:: cmake
  15. add_executable(exe main.c)
  16. The ``OLD`` behavior for this policy is to implicitly append known extensions
  17. to source files if they can't be found. The ``NEW`` behavior of this policy is
  18. to not append known extensions and require them to be explicit.
  19. .. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.20
  20. .. |WARNS_OR_DOES_NOT_WARN| replace:: warns
  21. .. include:: STANDARD_ADVICE.txt
  22. .. include:: DEPRECATED.txt