|
2 | 2 | # Distributed under the MIT software license, see the accompanying
|
3 | 3 | # file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
4 | 4 |
|
5 |
| -cmake_minimum_required(VERSION 3.12) |
| 5 | +# Call cmake_minimum_required() only if it was not already called, so parent |
| 6 | +# projects set the policy version when this project is included via |
| 7 | +# add_subdirectory(). |
| 8 | +# |
| 9 | +# Rationale: Different projects have different practices for choosing policy |
| 10 | +# versions. For example, the Bitcoin Core project sets an old policy version, |
| 11 | +# causing CMake to use deprecated behaviors instead of new behaviors and |
| 12 | +# maximize compatibility with a single old version of CMake, reducing variance |
| 13 | +# between builds with newer CMake versions. By contrast CMake documentation |
| 14 | +# recommends setting the policy version to the latest supported version of |
| 15 | +# CMake, as an upgrading mechanism rather than a pinning mechanism, to let |
| 16 | +# project authors fix problems before enabling newer policies, while not opting |
| 17 | +# into deprecated policies on a longer term basis. |
| 18 | +if(NOT DEFINED CMAKE_MINIMUM_REQUIRED_VERSION |
| 19 | + OR CMAKE_MINIMUM_REQUIRED_VERSION VERSION_LESS 3.12) |
| 20 | + # The left number in the range below is the minimum CMake version required to |
| 21 | + # run this project. The right number is the CMake policy version. |
| 22 | + # |
| 23 | + # The purpose of the minimum version is to trigger a helpful error if a version |
| 24 | + # of CMake is being used that is too old to work. If this number is changed, |
| 25 | + # the version in ci/configs/olddeps.bash should be changed to match. |
| 26 | + # |
| 27 | + # The purpose of the policy version is to opt out of policies introduced in |
| 28 | + # newer versions of CMake until they have been tested. If this number is |
| 29 | + # changed, the version in ci/configs/newdeps.bash should be changed to match. |
| 30 | + cmake_minimum_required(VERSION 3.12...4.1 FATAL_ERROR) |
| 31 | +endif() |
6 | 32 |
|
7 | 33 | project("Libmultiprocess" CXX)
|
8 | 34 | if(CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
|
|
0 commit comments