From a set of CMakeLists.txt
files, how can I determine an appropriate version number for cmake_minimum_required()
? Is there a better way than being familiar with the history of CMake features and using trial and error?
CMake ≥ 3.19 is strongly recommended for general users for more robust and easy syntax. For project developers, we recommend CMake ≥ 3.25 as the new features make debugging CMake and setting up CI considerably easier. Downloading the latest release of CMake is usually easy.
The cmake_minimum_required(VERSION) command implicitly invokes the cmake_policy(VERSION) command to specify that the current project code is written for the given range of CMake versions.
CMakeLists. txt file contains a set of directives and instructions describing the project's source files and targets (executable, library, or both). When you create a new project, CLion generates CMakeLists. txt file automatically and places it in the project root directory.
Run "cmake --help-policy CMP0069" for policy details. Use the cmake_policy command to set the policy and suppress this warning. INTERPROCEDURAL_OPTIMIZATION property will be ignored for target 'msgr-recv'. This warning is for project developers.
CMake has per-version documentation on its website. Using it, you may check that all features you use in your project are supported by a specific CMake version.
Features include command names, command options and their possible values, names of modules shipped with CMake.
Usually project does not need precise minimum CMake version. You may take reasonable version, which is accessible for users, and check whether this version supports all features you use.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With