1
0
mirror of synced 2025-01-20 18:27:00 +01:00

chore: bump to 3.31.0

This commit is contained in:
Henry Schreiner 2024-11-07 14:42:03 +00:00
parent 0335f5e5d3
commit 861f0ce705
13 changed files with 4286 additions and 4432 deletions

View File

@ -1,12 +1,5 @@
[bumpversion]
current_version = 3.30.2
[bumpversion:file:.gitlab-ci.yml]
search = cmake-{current_version}-linux
replace = cmake-{new_version}-linux
[bumpversion:file (2):.gitlab-ci.yml]
serialize = {major}.{minor}
current_version = 3.31.0
[bumpversion:file:chapters/intro/installing.md]
search = cmake-{current_version}-linux

View File

@ -7,7 +7,7 @@ Certainly there are no shortage of problems when building.
But I think that, in 2023, we have a very good solution to quite a few of those problems.
It's CMake. Not CMake 2.8 though; that was released before C++11 even existed!
Nor the horrible examples out there for CMake (even those posted on KitWare's own tutorials list).
I'm talking about Modern CMake. CMake 3.15+, maybe even CMake 3.30+!
I'm talking about Modern CMake. CMake 3.15+, maybe even CMake 3.31+!
It's clean, powerful, and elegant, so you can spend most of your time coding, not adding lines to an unreadable, unmaintainable Make (Or CMake 2) file.
:::{note}

View File

@ -22,9 +22,9 @@ newest CMake versions. If you set it to 3.3 or less, you'll get the wrong
hidden symbols behaviour, etc. A list of policies and versions is available at
{{ cmake.format('policies') }}.
Starting in CMake 3.12, this supports a range, such as `VERSION 3.15...3.30`;
Starting in CMake 3.12, this supports a range, such as `VERSION 3.15...3.31`;
this means you support as low as 3.15 but have also tested it with the new
policy settings up to 3.30. This is much nicer on users that need the better
policy settings up to 3.31. This is much nicer on users that need the better
settings, and due to a trick in the syntax, it's backward compatible with older
versions of CMake (though actually running CMake 3.1-3.11 will only set the old
version of the policies, since those versions didn't treat this specially). New
@ -34,7 +34,7 @@ also usually have a very recent version of CMake.
This is what new projects should do:
```cmake
cmake_minimum_required(VERSION 3.15...3.30)
cmake_minimum_required(VERSION 3.15...3.31)
```
@ -129,7 +129,7 @@ Targets can have include directories, linked libraries (or linked targets), comp
See if you can follow the following file. It makes a simple C++11 library and a program using it. No dependencies. I'll discuss more C++ standard options later, using the CMake 3.8 system for now.
```cmake
cmake_minimum_required(VERSION 3.15...3.30)
cmake_minimum_required(VERSION 3.15...3.31)
project(Calculator LANGUAGES CXX)

View File

@ -6,7 +6,7 @@ Your CMake version should be newer than your compiler. It should be newer than t
:::
If you have a built in copy of CMake, it isn't special or customized for your system. You can easily install a new one instead, either on the system level or the user level. Feel free to instruct your users here if they complain about a CMake requirement being set too high. Especially if they want 3.15+ support. Maybe even if they want 3.30+ support...
If you have a built in copy of CMake, it isn't special or customized for your system. You can easily install a new one instead, either on the system level or the user level. Feel free to instruct your users here if they complain about a CMake requirement being set too high. Especially if they want 3.15+ support. Maybe even if they want 3.31+ support...
## Quick list (more info on each method below)
@ -37,14 +37,14 @@ You can [download CMake from KitWare][download]. This is how you will probably g
On Linux, there are several options. Kitware provides a [Debian/Ubuntu apt repository][apt], as well as [snap packages][snap]. There are universal Linux binaries provided, but you'll need to pick an install location. If you already use `~/.local` for user-space packages, the following single line command[^1] will get CMake for you [^2]:
```bash
~ $ wget -qO- "https://cmake.org/files/v3.30/cmake-3.30.2-linux-x86_64.tar.gz" | tar --strip-components=1 -xz -C ~/.local
~ $ wget -qO- "https://cmake.org/files/v3.31/cmake-3.31.0-linux-x86_64.tar.gz" | tar --strip-components=1 -xz -C ~/.local
```
The names changed in 3.20; older releases had names like `cmake-3.19.7-Linux-x86_64.tar.gz`. If you just want a local folder with CMake only:
```bash
~ $ mkdir -p cmake-3.30 && wget -qO- "https://cmake.org/files/v3.30/cmake-3.30.2-linux-x86_64.tar.gz" | tar --strip-components=1 -xz -C cmake-3.30
~ $ export PATH=`pwd`/cmake-3.30/bin:$PATH
~ $ mkdir -p cmake-3.31 && wget -qO- "https://cmake.org/files/v3.31/cmake-3.31.0-linux-x86_64.tar.gz" | tar --strip-components=1 -xz -C cmake-3.31
~ $ export PATH=`pwd`/cmake-3.31/bin:$PATH
```
You'll obviously want to append to the PATH every time you start a new terminal, or add it to your `.bashrc` or to an [LMod][] system.
@ -52,7 +52,7 @@ You'll obviously want to append to the PATH every time you start a new terminal,
And, if you want a system install, install to `/usr/local`; this is an excellent choice in a Docker container, for example on GitLab CI. Do not try it on a non-containerized system.
```bash
docker $ wget -qO- "https://cmake.org/files/v3.30/cmake-3.30.2-linux-x86_64.tar.gz" | tar --strip-components=1 -xz -C /usr/local
docker $ wget -qO- "https://cmake.org/files/v3.31/cmake-3.31.0-linux-x86_64.tar.gz" | tar --strip-components=1 -xz -C /usr/local
```
If you are on a system without wget, replace `wget -qO-` with `curl -s`.
@ -130,8 +130,8 @@ Just `pip install cmake` on many systems. Add `--user` if you have to (modern pi
| Distribution | CMake version | Notes |
| ------------------------------------------------------------------------------------------------------------------------------------ | ------------- | ------------------------------------------------------------ |
| [Azure DevOps](https://docs.microsoft.com/en-us/azure/devops/pipelines/agents/hosted?view=azure-devops#use-a-microsoft-hosted-agent) | 3.30.0 | kept up to date |
| [GitHub Actions 20.04](https://github.com/actions/virtual-environments/blob/main/images/linux/Ubuntu2004-Readme.md) | 3.30.0 | Same runners as Azure DevOps |
| [Azure DevOps](https://docs.microsoft.com/en-us/azure/devops/pipelines/agents/hosted?view=azure-devops#use-a-microsoft-hosted-agent) | 3.31.0 | kept up to date |
| [GitHub Actions 20.04](https://github.com/actions/virtual-environments/blob/main/images/linux/Ubuntu2004-Readme.md) | 3.31.0 | Same runners as Azure DevOps |
If you are using GitHub Actions, also see the [jwlawson/actions-setup-cmake](https://github.com/marketplace/actions/actions-setup-cmake) action, which can install your selection of CMake, even in a docker action run.

View File

@ -4,9 +4,26 @@ This is an abbreviated version of the CMake changelog with just the highlights f
## [CMake in development][cmake master]: WIP
Nothing to report yet.
## [CMake 3.31][]: Better workflow presets
This release adds a collection of small features and additions, along with some
experimental new technology. Some updates to presets, including a new shorter
command for workflow presents.
- Initially released November 6, 2024
- LFortan now supported
- `$comment` supported in preset files
- `cmake -LR <regex>` to search the cache
- `cmake --workflow <name>` now supported (one less argument)
- `codegen` target and `CODEGEN` in `add_custom_command`
- Added `cmake_pkg_config` command to extract values from pkg-config files.
- `CMAKE_HOST_EXECUTABLE_SUFFIX` was added
- Better CUDA support, including getting the host compiler and OpenMP
- Support for CMake 3.10 and older deprecated
- Lots of smaller tweaks and cleanup
- [Experimental](https://www.kitware.com/a-year-closer-to-standard-c-dependency-management/) CPS (common package specification) support
## [CMake 3.30][]: C++26
@ -19,7 +36,7 @@ updates.
- A `$<QUOTE>` generator expression was added to produce `"`
- C++26 compile features support fully implemented (partial since 3.25)
- `CMAKE_<LANG>_STANDARD_LATEST` holds the latest standard the current compiler supports
- Free-threaded Python 3.13+ support
- Free-threaded Python 3.13+ support (3.30.3+ best)
- Better support (new variables and targets) for Windows Python debug builds, and `DEBUG_POSTFIX` now added by `python_add_library`
- FindBoost removed
- Visual Studio 2008 support removed

View File

@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.15...3.30)
cmake_minimum_required(VERSION 3.15...3.31)
project(ModernCMakeExamples)
set(MODERN_CMAKE_BUILD_TESTING ON)

View File

@ -1,5 +1,5 @@
# Works with 3.15 and tested through 3.30
cmake_minimum_required(VERSION 3.15...3.30)
# Works with 3.15 and tested through 3.31
cmake_minimum_required(VERSION 3.15...3.31)
# Project name and a few useful settings. Other commands can pick up the results
project(

View File

@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.15...3.30)
cmake_minimum_required(VERSION 3.15...3.31)
project(FetchExample LANGUAGES CXX)

View File

@ -2,7 +2,7 @@
## [main]
cmake_minimum_required(VERSION 3.15...3.30)
cmake_minimum_required(VERSION 3.15...3.31)
project(RootDictExample LANGUAGES CXX)

View File

@ -1,7 +1,7 @@
# CMake ROOT simple example
## [main]
cmake_minimum_required(VERSION 3.15...3.30)
cmake_minimum_required(VERSION 3.15...3.31)
project(RootSimpleExample LANGUAGES CXX)

View File

@ -1,7 +1,7 @@
# CMake ROOT usefile example
## [main]
cmake_minimum_required(VERSION 3.15...3.30)
cmake_minimum_required(VERSION 3.15...3.31)
project(RootUseFileExample LANGUAGES CXX)

View File

@ -6,7 +6,7 @@
# You should always specify a range with the newest
# and oldest tested versions of CMake. This will ensure
# you pick up the best policies.
cmake_minimum_required(VERSION 3.15...3.30)
cmake_minimum_required(VERSION 3.15...3.31)
# This is your project statement. You should always list languages;
# Listing the version is nice here since it sets lots of useful variables

8650
pixi.lock generated

File diff suppressed because it is too large Load Diff