fix: minor cleanups
Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>
This commit is contained in:
parent
684f587093
commit
f2e36349bf
@ -1,6 +1,6 @@
|
|||||||
repos:
|
repos:
|
||||||
- repo: https://github.com/pre-commit/pre-commit-hooks
|
- repo: https://github.com/pre-commit/pre-commit-hooks
|
||||||
rev: v3.2.0
|
rev: v4.2.0
|
||||||
hooks:
|
hooks:
|
||||||
- id: check-added-large-files
|
- id: check-added-large-files
|
||||||
- id: check-case-conflict
|
- id: check-case-conflict
|
||||||
@ -9,6 +9,7 @@ repos:
|
|||||||
- id: check-yaml
|
- id: check-yaml
|
||||||
- id: debug-statements
|
- id: debug-statements
|
||||||
- id: end-of-file-fixer
|
- id: end-of-file-fixer
|
||||||
|
exclude: \.cmake$
|
||||||
- id: mixed-line-ending
|
- id: mixed-line-ending
|
||||||
- id: requirements-txt-fixer
|
- id: requirements-txt-fixer
|
||||||
- id: trailing-whitespace
|
- id: trailing-whitespace
|
||||||
|
@ -38,7 +38,7 @@ On Linux, there are several options. Kitware provides a [Debian/Ubunutu apt repo
|
|||||||
~ $ wget -qO- "https://cmake.org/files/v3.23/cmake-3.23.1-linux-x86_64.tar.gz" | tar --strip-components=1 -xz -C ~/.local
|
~ $ wget -qO- "https://cmake.org/files/v3.23/cmake-3.23.1-linux-x86_64.tar.gz" | tar --strip-components=1 -xz -C ~/.local
|
||||||
{% endterm %}
|
{% endterm %}
|
||||||
|
|
||||||
The names changed in 3.23; older releases had names like `cmake-3.19.7-Linux-x86_64.tar.gz`. If you just want a local folder with CMake only:
|
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:
|
||||||
|
|
||||||
{% term %}
|
{% term %}
|
||||||
~ $ mkdir -p cmake-3.23 && wget -qO- "https://cmake.org/files/v3.23/cmake-3.23.1-linux-x86_64.tar.gz" | tar --strip-components=1 -xz -C cmake-3.23
|
~ $ mkdir -p cmake-3.23 && wget -qO- "https://cmake.org/files/v3.23/cmake-3.23.1-linux-x86_64.tar.gz" | tar --strip-components=1 -xz -C cmake-3.23
|
||||||
@ -101,10 +101,10 @@ You should only use the default CMake on 18.04+; it's an LTS release with a pret
|
|||||||
|
|
||||||
#### Debian
|
#### Debian
|
||||||
|
|
||||||
[![Debian 10 package](https://repology.org/badge/version-for-repo/debian_10/cmake.svg)][repology]
|
[![Debian 10 package](https://repology.org/badge/version-for-repo/debian_10/cmake.svg)][repology]
|
||||||
[![Debian 10 backports package](https://repology.org/badge/version-for-repo/debian_10_backports/cmake.svg)][repology]
|
[![Debian 10 backports package](https://repology.org/badge/version-for-repo/debian_10_backports/cmake.svg)][repology]
|
||||||
[![Debian 11 package](https://repology.org/badge/version-for-repo/debian_11/cmake.svg)][repology]
|
[![Debian 11 package](https://repology.org/badge/version-for-repo/debian_11/cmake.svg)][repology]
|
||||||
[![Debian 11 backports package](https://repology.org/badge/version-for-repo/debian_11_backports/cmake.svg)][repology]
|
[![Debian 11 backports package](https://repology.org/badge/version-for-repo/debian_11_backports/cmake.svg)][repology]
|
||||||
[![Debian Unstable package](https://repology.org/badge/version-for-repo/debian_unstable/cmake.svg)][repology]
|
[![Debian Unstable package](https://repology.org/badge/version-for-repo/debian_unstable/cmake.svg)][repology]
|
||||||
|
|
||||||
#### Other
|
#### Other
|
||||||
|
@ -302,7 +302,7 @@ for permissions. Further support for generator expressions in more places.
|
|||||||
* `DIRECTORY` can now include a binary directory in property commands
|
* `DIRECTORY` can now include a binary directory in property commands
|
||||||
* New `JSON` commands for `string`
|
* New `JSON` commands for `string`
|
||||||
* New `OPTIMIZE_DEPENDENCIES` property and `CMAKE_*` variable for smartly dropping dependencies of static and object libraries.
|
* New `OPTIMIZE_DEPENDENCIES` property and `CMAKE_*` variable for smartly dropping dependencies of static and object libraries.
|
||||||
* PCH support expanded with `PCH_INSTANTIATE_TEMPLATES` property and `CMAKE_*` variable.
|
* PCH support expanded with `PCH_INSTANTIATE_TEMPLATES` property and `CMAKE_*` variable.
|
||||||
* Check modules have been expanded with `CUDA` and `ISPC` languages
|
* Check modules have been expanded with `CUDA` and `ISPC` languages
|
||||||
* FindPython: `Python*_LINK_OPTIONS` added
|
* FindPython: `Python*_LINK_OPTIONS` added
|
||||||
* `compute-sanitizer` for ctest now supports CUDA for memcheck
|
* `compute-sanitizer` for ctest now supports CUDA for memcheck
|
||||||
@ -392,6 +392,30 @@ couple of compilers were added.
|
|||||||
* `IMPORTED_NO_SYSTEM`, a new property to forcibly remove SYSTEM from a target.
|
* `IMPORTED_NO_SYSTEM`, a new property to forcibly remove SYSTEM from a target.
|
||||||
* `FindGTest` now adds a `GMock` target if found.
|
* `FindGTest` now adds a `GMock` target if found.
|
||||||
|
|
||||||
|
|
||||||
|
## [CMake 3.24][CMake master]: WIP
|
||||||
|
|
||||||
|
The next release is shaping up to be a fantastic release. Package writers are
|
||||||
|
getting integration between `find_package` and `FetchContent` that will allow
|
||||||
|
"download if missing" workflows, and is configurable by packagers. Similarly,
|
||||||
|
warnings as errors can be set by a package and removed by packagers, as well
|
||||||
|
(still make sure not to do this unless you are being build as the main
|
||||||
|
project!).
|
||||||
|
|
||||||
|
|
||||||
|
* `--fresh` option removes the old cache when running.
|
||||||
|
* `find_package` and `FetchContent` now have integration - you have options to download missing dependencies.
|
||||||
|
* `find_package` has a new `GLOBAL` option.
|
||||||
|
* `CMAKE_PROJECT_TOP_LEVEL_INCLUDES` allows a user (like packagers) to inject pre-project code.
|
||||||
|
* `PATH` management for generator expressions.
|
||||||
|
* `CMAKE_COLOR_DIAGNOSTICS` env var & variable added, replacing `CMAKE_COLOR_MAKEFILE`.
|
||||||
|
* You can disable `find_*` searching the install prefix.
|
||||||
|
* `COMPILE_WARNING_AS_ERROR` property and `CMAKE_` variable, and `--compile-no-warning-as-error` to disable it.
|
||||||
|
* CUDA supports `native` to compile for the current GPUs detected.
|
||||||
|
* `SYSTEM` includes now are respected on MSVC generators.
|
||||||
|
* Better support for MSVC, XCode, and others.
|
||||||
|
* `LLVMFlang` compiler support.
|
||||||
|
|
||||||
[Releases]: https://cmake.org/cmake/help/latest/release/index.html
|
[Releases]: https://cmake.org/cmake/help/latest/release/index.html
|
||||||
[CMake 3.0]: https://cmake.org/cmake/help/latest/release/3.0.html
|
[CMake 3.0]: https://cmake.org/cmake/help/latest/release/3.0.html
|
||||||
[CMake 3.1]: https://cmake.org/cmake/help/latest/release/3.1.html
|
[CMake 3.1]: https://cmake.org/cmake/help/latest/release/3.1.html
|
||||||
@ -419,4 +443,3 @@ couple of compilers were added.
|
|||||||
[CMake 3.23]: https://cmake.org/cmake/help/latest/release/3.23.html
|
[CMake 3.23]: https://cmake.org/cmake/help/latest/release/3.23.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/
|
||||||
|
|
||||||
|
@ -62,12 +62,12 @@ Dictionary generation is ROOT's way of working around the missing reflection fea
|
|||||||
* Your class definition should end with `ClassDef(MyClassName, 1)`
|
* Your class definition should end with `ClassDef(MyClassName, 1)`
|
||||||
* Your class implementation should have `ClassImp(MyClassName)` in it
|
* Your class implementation should have `ClassImp(MyClassName)` in it
|
||||||
|
|
||||||
ROOT provides `rootcling` and `genreflex` (a legacy interface to `rootcling`) binaries which produce the source files required to build the dictionary. It also defines `root_generate_dictionary`, a CMake function to invoke `rootcling` during the build process.
|
ROOT provides `rootcling` and `genreflex` (a legacy interface to `rootcling`) binaries which produce the source files required to build the dictionary. It also defines `root_generate_dictionary`, a CMake function to invoke `rootcling` during the build process.
|
||||||
|
|
||||||
To load this function, first include the ROOT macros:
|
To load this function, first include the ROOT macros:
|
||||||
```cmake
|
```cmake
|
||||||
include("${ROOT_DIR}/modules/RootNewMacros.cmake")
|
include("${ROOT_DIR}/modules/RootNewMacros.cmake")
|
||||||
# For ROOT versions than 6.16, things break
|
# For ROOT versions than 6.16, things break
|
||||||
# if nothing is in the global include list!
|
# if nothing is in the global include list!
|
||||||
if (${ROOT_VERSION} VERSION_LESS "6.16")
|
if (${ROOT_VERSION} VERSION_LESS "6.16")
|
||||||
include_directories(ROOT_NONEXISTENT_DIRECTORY_HACK)
|
include_directories(ROOT_NONEXISTENT_DIRECTORY_HACK)
|
||||||
@ -101,7 +101,7 @@ add_library(Example)
|
|||||||
root_generate_dictionary(G__Example Example.h MODULE Example LINKDEF ExampleLinkDef.h)
|
root_generate_dictionary(G__Example Example.h MODULE Example LINKDEF ExampleLinkDef.h)
|
||||||
```
|
```
|
||||||
|
|
||||||
The full name of the dictionary (e.g. `G__Example`) should not be identical to the `MODULE` argument.
|
The full name of the dictionary (e.g. `G__Example`) should not be identical to the `MODULE` argument.
|
||||||
|
|
||||||
|
|
||||||
[linkdef-root]: https://root.cern.ch/selecting-dictionary-entries-linkdefh
|
[linkdef-root]: https://root.cern.ch/selecting-dictionary-entries-linkdefh
|
||||||
|
@ -6,7 +6,9 @@ cmake_minimum_required(VERSION 3.4...3.23)
|
|||||||
|
|
||||||
project(RootDictExample LANGUAGES CXX)
|
project(RootDictExample LANGUAGES CXX)
|
||||||
|
|
||||||
set(CMAKE_CXX_STANDARD 11 CACHE STRING "C++ standard to use")
|
set(CMAKE_CXX_STANDARD
|
||||||
|
11
|
||||||
|
CACHE STRING "C++ standard to use")
|
||||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||||
set(CMAKE_CXX_EXTENSIONS OFF)
|
set(CMAKE_CXX_EXTENSIONS OFF)
|
||||||
set(CMAKE_PLATFORM_INDEPENDENT_CODE ON)
|
set(CMAKE_PLATFORM_INDEPENDENT_CODE ON)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user