mirror of
1
0
Fork 0

Merge branch 'henryiii/3.17.0' into 'master'

Adding CMake 3.17.0

See merge request CLIUtils/modern-cmake!27
This commit is contained in:
Henry Schreiner 2020-03-20 14:21:33 +00:00
commit dbe0c45737
4 changed files with 22 additions and 14 deletions

View File

@ -6,7 +6,7 @@ test_code:
- yum install -y make cmake boost-devel git - yum install -y make cmake boost-devel git
# will install latest CMake, even though Fedora has a recent one # will install latest CMake, even though Fedora has a recent one
- mkdir -p $HOME/.local - mkdir -p $HOME/.local
- curl -s "https://cmake.org/files/v3.16/cmake-3.16.3-Linux-x86_64.tar.gz" | tar --strip-components=1 -xz -C $HOME/.local - curl -s "https://cmake.org/files/v3.17/cmake-3.17.0-Linux-x86_64.tar.gz" | tar --strip-components=1 -xz -C $HOME/.local
- export PATH=$HOME/.local/bin:$PATH - export PATH=$HOME/.local/bin:$PATH
script: script:
- cmake -S examples -B build - cmake -S examples -B build

View File

@ -7,7 +7,7 @@ Certainly there are no shortage of problems when building.
But I think that, in 2020, we have a very good solution to quite a few of those problems. But I think that, in 2020, 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! 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). 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.16+! I'm talking about Modern CMake. CMake 3.1+, maybe even CMake 3.17+!
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. 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! And CMake 3.11+ is supposed to be significantly faster, as well!

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. 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 %} {% 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.16 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.17 support...
#### Quick list (more info on each method below) #### Quick list (more info on each method below)
@ -34,14 +34,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/Ubunutu 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]: On Linux, there are several options. Kitware provides a [Debian/Ubunutu 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]:
{% term %} {% term %}
~ $ wget -qO- "https://cmake.org/files/v3.16/cmake-3.16.3-Linux-x86_64.tar.gz" | tar --strip-components=1 -xz -C ~/.local ~ $ wget -qO- "https://cmake.org/files/v3.17/cmake-3.17.0-Linux-x86_64.tar.gz" | tar --strip-components=1 -xz -C ~/.local
{% endterm %} {% endterm %}
If you just want a local folder with CMake only: If you just want a local folder with CMake only:
{% term %} {% term %}
~ $ mkdir -p cmake-3.16 && wget -qO- "https://cmake.org/files/v3.16/cmake-3.16.3-Linux-x86_64.tar.gz" | tar --strip-components=1 -xz -C cmake-3.16 ~ $ mkdir -p cmake-3.17 && wget -qO- "https://cmake.org/files/v3.17/cmake-3.17.0-Linux-x86_64.tar.gz" | tar --strip-components=1 -xz -C cmake-3.17
~ $ export PATH=`pwd`/cmake-3.16/bin:$PATH ~ $ export PATH=`pwd`/cmake-3.17/bin:$PATH
{% endterm %} {% 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. 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.
@ -49,7 +49,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. 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 %} {% term %}
docker $ wget -qO- "https://cmake.org/files/v3.16/cmake-3.16.3-Linux-x86_64.tar.gz" | tar --strip-components=1 -xz -C /usr/local docker $ wget -qO- "https://cmake.org/files/v3.17/cmake-3.17.0-Linux-x86_64.tar.gz" | tar --strip-components=1 -xz -C /usr/local
{% endterm %} {% endterm %}
@ -73,13 +73,13 @@ Here are some common build environments and the CMake version you'll find on the
| [Ubuntu 19.04: Disco](https://launchpad.net/ubuntu/disco/+source/cmake) | 3.13.4 | | | [Ubuntu 19.04: Disco](https://launchpad.net/ubuntu/disco/+source/cmake) | 3.13.4 | |
| [Ubuntu 19.10: Eoan](https://launchpad.net/ubuntu/eoan/+source/cmake) | 3.13.4 | Oddly identical to Disco. | | [Ubuntu 19.10: Eoan](https://launchpad.net/ubuntu/eoan/+source/cmake) | 3.13.4 | Oddly identical to Disco. |
| [AlpineLinux 3.11](https://pkgs.alpinelinux.org/packages?name=cmake&branch=v3.11)| 3.15.5 | Useful in Docker | | [AlpineLinux 3.11](https://pkgs.alpinelinux.org/packages?name=cmake&branch=v3.11)| 3.15.5 | Useful in Docker |
| [Python PyPI][PyPI] | 3.15.3 | Just `pip install cmake` on many systems. Add `--user` for local installs. (ManyLinux1 (old pip or OS) gets CMake 3.13.3)| | [Python PyPI][PyPI] | 3.16.3 | Just `pip install cmake` on many systems. Add `--user` for local installs. (ManyLinux1 (old pip or OS) gets CMake 3.13.3)|
| [Anaconda][] | 3.14.0 | For use with Conda | | [Anaconda][] | 3.14.0 | For use with Conda |
| [Conda-Forge][] | 3.16.3 | For use with Conda | | [Conda-Forge][] | 3.16.4 | For use with Conda |
| [Homebrew on macOS][homebrew] | 3.16.3 | On macOS with Homebrew, this is only a few minutes behind cmake.org. | | [Homebrew on macOS][homebrew] | 3.16.5 | On macOS with Homebrew, this is only a few minutes behind cmake.org. |
| [MacPorts on macOS][macports] | 3.16.3 | Useful if you use the less popular MacPorts. | | [MacPorts on macOS][macports] | 3.16.5 | Useful if you use the less popular MacPorts. |
| [Chocolatey on Windows][chocolatey] | 3.16.2 | Also up to date. The normal cmake.org installers are common on Windows, as well. | | [Chocolatey on Windows][chocolatey] | 3.16.5 | Also up to date. The normal cmake.org installers are common on Windows, as well. |
| [Scoop on Windows][scoop] | 3.16.5 | Also up to date. The normal cmake.org installers are common on Windows, as well. | | [Scoop on Windows][scoop] | 3.17.0 | Also up to date. The normal cmake.org installers are common on Windows, as well. |
| [MSYS2 on Windows][MSYS2] | 3.16.5-1 | Also up to date. Available for both i386 & x86_64. | | [MSYS2 on Windows][MSYS2] | 3.16.5-1 | Also up to date. Available for both i386 & x86_64. |
| [TravisCI Xenial](https://docs.travis-ci.com/user/reference/xenial/#compilers-and-build-toolchain) | 3.12.4 | Mid November 2018 this image became ready for widescale use. | | [TravisCI Xenial](https://docs.travis-ci.com/user/reference/xenial/#compilers-and-build-toolchain) | 3.12.4 | Mid November 2018 this image became ready for widescale use. |
| [TravisCI Bionic](https://docs.travis-ci.com/user/reference/bionic/#compilers-and-build-toolchain) | 3.12.4 | Same as Xenial at the moment. | | [TravisCI Bionic](https://docs.travis-ci.com/user/reference/bionic/#compilers-and-build-toolchain) | 3.12.4 | Same as Xenial at the moment. |

View File

@ -221,11 +221,18 @@ fixes were implemented, especially to newer features, such as to FindPython, Fin
* Generator expressions work in more places, like build and install paths * Generator expressions work in more places, like build and install paths
* Find locations can now be explicitly controlled through new variables * Find locations can now be explicitly controlled through new variables
## [CMake 3.17 (in progress)][CMake master] : More CUDA ## [CMake 3.17][] : More CUDA
A FindCUDAToolkit was finally added, which allows finding and using the CUDA
toolkit without enabling the CUDA language! CUDA now is a bit more configurable,
such as linking to shared libraries. Quite a bit more polish in the expected areas,
as well, like FindPython. Finally, you can now iterate over multiple lists at a time.
* `CUDA_RUNTIME_LIBRARY` can finally be set to Shared! * `CUDA_RUNTIME_LIBRARY` can finally be set to Shared!
* FindCUDAToolkit finally added * FindCUDAToolkit finally added
* `cmake -E rm` replaces older remove commands
* CUDA has meta features like `cuda_std_03`, etc. * CUDA has meta features like `cuda_std_03`, etc.
* You can track the searches for packages with `--debug-find`
* ExternalProject can now disable recursive checkouts * ExternalProject can now disable recursive checkouts
* FindPython better integration with Conda * FindPython better integration with Conda
* DEPRECATION can be applied to targets * DEPRECATION can be applied to targets
@ -251,5 +258,6 @@ fixes were implemented, especially to newer features, such as to FindPython, Fin
[CMake 3.14]: https://cmake.org/cmake/help/latest/release/3.14.html [CMake 3.14]: https://cmake.org/cmake/help/latest/release/3.14.html
[CMake 3.15]: https://cmake.org/cmake/help/latest/release/3.15.html [CMake 3.15]: https://cmake.org/cmake/help/latest/release/3.15.html
[CMake 3.16]: https://cmake.org/cmake/help/latest/release/3.16.html [CMake 3.16]: https://cmake.org/cmake/help/latest/release/3.16.html
[CMake 3.17]: https://cmake.org/cmake/help/latest/release/3.17.html
[CMake master]: https://cmake.org/cmake/help/git-master/release/index.html [CMake master]: https://cmake.org/cmake/help/git-master/release/index.html
[fastercmake]: https://blog.kitware.com/improving-cmakes-runtime-performance/ [fastercmake]: https://blog.kitware.com/improving-cmakes-runtime-performance/