Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Determine appropriate version for cmake_minimum_required()

Tags:

cmake

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?

like image 459
Praxeolitic Avatar asked May 22 '16 04:05

Praxeolitic


People also ask

What CMake version should I use?

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.

What is Cmake_minimum_required?

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.

What are CMakeLists txt?

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.

How do I set up a CMake policy?

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.


1 Answers

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.

like image 68
Tsyvarev Avatar answered Oct 12 '22 06:10

Tsyvarev