1
0
mirror of synced 2024-12-22 12:40:00 +01:00

Update to CMake 3.14

This commit is contained in:
Henry Fredrick Schreiner 2019-03-20 17:23:14 -04:00
parent dc9687eda5
commit 5324b8342d
7 changed files with 15 additions and 15 deletions

View File

@ -4,7 +4,7 @@ test_code:
stage: test
before_script:
- mkdir -p $HOME/.local
- curl -s "https://cmake.org/files/v3.13/cmake-3.13.4-Linux-x86_64.tar.gz" | tar --strip-components=1 -xz -C $HOME/.local
- curl -s "https://cmake.org/files/v3.14/cmake-3.14.0-Linux-x86_64.tar.gz" | tar --strip-components=1 -xz -C $HOME/.local
- export PATH=$HOME/.local/bin:$PATH
script:
- mkdir -p build

View File

@ -7,7 +7,7 @@ Certainly there are no shortage of problems when building.
But I think that, in 2018, 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.1+, maybe even CMake 3.13+!
I'm talking about Modern CMake. CMake 3.1+, maybe even CMake 3.14+!
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.
And CMake 3.11+ is supposed to be significantly faster, as well!

View File

@ -19,7 +19,7 @@ usually have a very recent version of CMake.
This is what new projects should do:
```cmake
cmake_minimum_required(VERSION 3.1...3.13)
cmake_minimum_required(VERSION 3.1...3.14)
if(${CMAKE_VERSION} VERSION_LESS 3.12)
cmake_policy(VERSION ${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION})
@ -33,10 +33,10 @@ WARNING: MSVC's CMake server mode [originally had a bug](https://github.com/fmtl
```cmake
cmake_minimum_required(VERSION 3.1)
if(${CMAKE_VERSION} VERSION_LESS 3.13)
if(${CMAKE_VERSION} VERSION_LESS 3.14)
cmake_policy(VERSION ${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION})
else()
cmake_policy(VERSION 3.13)
cmake_policy(VERSION 3.14)
endif()
```

View File

@ -12,8 +12,8 @@ You'll need to pick a minimum required version of CMake. This will affect the CM
| Ubuntu 16.04 LTS | 3.5.1 | |
| Ubuntu 18.04 LTS | 3.10.2 | An LTS with a pretty decent minimum version! |
| Ubuntu 18.10 | 3.12.1| |
| [Python PyPI](https://pypi.org/project/cmake/) | 3.13.0 | Just `pip install cmake` on many systems. Add `--user` for local installs. |
| Homebrew on macOS | latest | On macOS with Homebrew, this is only a few minutes behind cmake.org. |
| [Python PyPI](https://pypi.org/project/cmake/) | 3.13.3 | Just `pip install cmake` on many systems. Add `--user` for local installs. |
| [Homebrew on macOS](https://formulae.brew.sh/formula/cmake) | latest | On macOS with Homebrew, this is only a few minutes behind cmake.org. |
| Chocolaty on Windows | latest | Also up to date. The normal cmake.org installers are common on Windows, as well. |
| TravisCI Trusty | 3.9 | The December 2017 update added a recent version of clang and CMake! Finally! |
| TravisCI Xenial | 3.12.4 | Mid November 2018 this image became ready for widescale use. |

View File

@ -4,7 +4,7 @@
Your CMake version should be newer than your compiler. It should be newer than the libraries you are using (especially Boost). New versions work better for everyone.
{% endhint %}
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.1 support. Maybe even if they want CMake < 3.13 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.1 support. Maybe even if they want CMake < 3.14 support...
## Official package
@ -13,14 +13,14 @@ You can [download CMake from KitWare][cmake-download]. This is how you'll probab
On Linux, there are 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]:
{% term %}
~ $ wget -qO- "https://cmake.org/files/v3.13/cmake-3.13.4-Linux-x86_64.tar.gz" | tar --strip-components=1 -xz -C ~/.local
~ $ wget -qO- "https://cmake.org/files/v3.14/cmake-3.14.0-Linux-x86_64.tar.gz" | tar --strip-components=1 -xz -C ~/.local
{% endterm %}
If you just want a local folder with CMake only:
{% term %}
~ $ mkdir -p cmake-3.13 && wget -qO- "https://cmake.org/files/v3.13/cmake-3.13.4-Linux-x86_64.tar.gz" | tar --strip-components=1 -xz -C cmake-3.13
~ $ export PATH=`pwd`/cmake-3.13/bin:$PATH
~ $ mkdir -p cmake-3.14 && wget -qO- "https://cmake.org/files/v3.14/cmake-3.14.0-Linux-x86_64.tar.gz" | tar --strip-components=1 -xz -C cmake-3.14
~ $ export PATH=`pwd`/cmake-3.14/bin:$PATH
{% endterm %}
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.
@ -28,7 +28,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.
{% term %}
docker $ wget -qO- "https://cmake.org/files/v3.13/cmake-3.13.4-Linux-x86_64.tar.gz" | tar --strip-components=1 -xz -C /usr/local
docker $ wget -qO- "https://cmake.org/files/v3.14/cmake-3.14.0-Linux-x86_64.tar.gz" | tar --strip-components=1 -xz -C /usr/local
{% endterm %}

View File

@ -179,7 +179,7 @@ of the source directory, for better file separation. And, `target_sources` *fina
* `target_sources` is now relative to the current source directory (CMP0076)
* If you use Xcode, you now can experimentally set schema fields
## [CMake 3.14][] : File utilities (in RC phase)
## [CMake 3.14][] : File utilities (AKA [CMake π](https://blog.kitware.com/kitware-gets-mathematical-with-cmake-π-on-pi-day/))
This release has lots of small cleanups, including several utilities for files. Generator expressions work in a few more places, and list handling is better with empty variables.
Quite a few more find packages produce targets. The new Visual Studio 16 2019 generator is a bit different than older versions. Windows XP and Vista support has been dropped.
@ -204,5 +204,5 @@ Quite a few more find packages produce targets. The new Visual Studio 16 2019 ge
[CMake 3.11]: https://cmake.org/cmake/help/latest/release/3.11.html
[CMake 3.12]: https://cmake.org/cmake/help/latest/release/3.12.html
[CMake 3.13]: https://cmake.org/cmake/help/latest/release/3.13.html
[CMake 3.14]: https://cmake.org/cmake/help/3.14/release/3.14.html
[CMake 3.14]: https://cmake.org/cmake/help/latest/release/3.14.html
[fastercmake]: https://blog.kitware.com/improving-cmakes-runtime-performance/

View File

@ -5,7 +5,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.1...3.13)
cmake_minimum_required(VERSION 3.1...3.14)
# This is your project statement. You should always list languages;
# Listing the version is nice here since it sets lots of useful variables