Skip to content
This repository has been archived by the owner on Apr 19, 2023. It is now read-only.

Demonstrate how to use [max] in cmake_minimum_required(VERSION <min>[...<max>] #21

Open
vbaderks opened this issue Feb 29, 2020 · 0 comments

Comments

@vbaderks
Copy link

Currently a specific version of CMake is specified in the CMakeLists.txt:

https://github.com/lefticus/cpp_starter_project/blob/d7a2b6b891d75edc68c9d88dca7e24cd73e378b8/CMakeLists.txt#L1

CMake makes it however also possible (3.12 feature, but backwards compatible) to indicate a version range by using the format:

cmake_minimum_required(VERSION <min>[...<max>])

for example:

cmake_minimum_required(VERSION 3.13...3.17)

This makes it easier to use a wider range of CMake versions. Updating CMake on CI systems is sometimes difficult and proving a range could help to see that the current CMake version is already compatible.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant