CMP0000.rst 1.3 KB

123456789101112131415161718192021222324252627282930313233
  1. CMP0000
  2. -------
  3. .. |REMOVED_IN_CMAKE_VERSION| replace:: 4.0
  4. .. include:: include/REMOVED_PROLOGUE.rst
  5. A minimum required CMake version must be specified.
  6. CMake requires that projects specify the version of CMake to which
  7. they have been written. This policy has been put in place so users
  8. trying to build the project may be told when they need to update their
  9. CMake. Specifying a version also helps the project build with CMake
  10. versions newer than that specified. Use the :command:`cmake_minimum_required`
  11. command at the top of your main ``CMakeLists.txt`` file:
  12. .. code-block:: cmake
  13. cmake_minimum_required(VERSION <major>.<minor>)
  14. where ``<major>.<minor>`` is the version of CMake you want to support
  15. (such as ``3.14``). The command will ensure that at least the given
  16. version of CMake is running and help newer versions be compatible with
  17. the project. See documentation of :command:`cmake_minimum_required` for
  18. details.
  19. Note that the command invocation must appear in the ``CMakeLists.txt``
  20. file itself; a call in an included file is not sufficient. The ``OLD``
  21. behavior was to silently ignore the missing invocation. The ``NEW``
  22. behavior is to issue an error instead of a warning.
  23. .. |INTRODUCED_IN_CMAKE_VERSION| replace:: 2.6.0
  24. .. |WARNED_OR_DID_NOT_WARN| replace:: warned
  25. .. include:: include/REMOVED_EPILOGUE.rst