From aa81010530dee7dc908e69a14160b8301ab50a1e Mon Sep 17 00:00:00 2001 From: friendlyanon Date: Thu, 22 Feb 2024 11:47:54 +0100 Subject: [PATCH] Fix references to CMake in case of C17 and C23 With the C17 and C23 templates one must have at least CMake 3.21, because support for those standards was added in that version. --- README.md | 2 +- cmake-init/cmake_init.py | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 315743c..a0a5503 100644 --- a/README.md +++ b/README.md @@ -93,7 +93,7 @@ libraries! (Part 2)](https://www.youtube.com/watch?v=_5weX5mx8hc) Make sure you have these programs installed: * Python 3.8 or newer -* CMake 3.20 or newer +* CMake 3.20 or newer (3.21 or newer for C17 or newer projects) * git * [clang-tidy 14](#clang-tidy) (optional) * [cppcheck](#cppcheck) (optional) diff --git a/cmake-init/cmake_init.py b/cmake-init/cmake_init.py index e5a20a0..8601ff6 100644 --- a/cmake-init/cmake_init.py +++ b/cmake-init/cmake_init.py @@ -366,13 +366,14 @@ def create(args, zip): for zip_path in (f"templates/{p}" for p in zip_paths): write_dir(path, d, args.overwrite, zipfile.Path(zip, zip_path)) git_init(path) - print("""\ + cmake_version = "3.21" if d["cmake_321"] else "3.20" + print(f"""\ To get started with developing the project, make sure you read the generated HACKING.md and BUILDING.md files for how to build the project as a developer or as a user respectively. There are also some details you may want to fill in in the README.md, CONTRIBUTING.md and .github/workflows/ci.yml files. -Now make sure you have at least CMake 3.20 installed for local development, to +Now make sure you have at least CMake {cmake_version} installed for local development, to make use of all the nice Quality-of-Life improvements in newer releases: https://cmake.org/download/