From a51ef3402eb9a135af02813d059482ae13d4aba5 Mon Sep 17 00:00:00 2001 From: Jason Turner Date: Thu, 31 Mar 2022 21:42:47 -0600 Subject: [PATCH 1/8] Upgrade version of project_options being utilized --- CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 5bb3bee9..23f991b5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.16) +cmake_minimum_required(VERSION 3.18) # Not ideal to use this global variable, but necessary to make sure # that tooling and projects use the same version @@ -24,7 +24,7 @@ set(OPT_WARNINGS_AS_ERRORS_DEVELOPER_DEFAULT TRUE) # https://github.com/cpp-best-practices/project_options include(FetchContent) FetchContent_Declare(_project_options - URL https://github.com/cpp-best-practices/project_options/archive/refs/tags/v0.17.0.zip) + URL https://github.com/cpp-best-practices/project_options/archive/refs/tags/v0.20.0.zip) FetchContent_MakeAvailable(_project_options) include(${_project_options_SOURCE_DIR}/Index.cmake) From 1a5972a823b3ca017cd71058eb540b0f50e2dd8c Mon Sep 17 00:00:00 2001 From: David Dalcino Date: Thu, 31 Mar 2022 22:38:17 -0700 Subject: [PATCH 2/8] Re-enable Conan for package management --- CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 23f991b5..7f8259bd 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -92,6 +92,7 @@ dynamic_project_options( PCH_HEADERS # This is a list of headers to pre-compile, here are some common ones + ENABLE_CONAN # Use Conan for package management # CONAN_OPTIONS # Extra options to pass to conan # MSVC_WARNINGS # Override the defaults for the MSVC warnings # CLANG_WARNINGS # Override the defaults for the CLANG warnings From 2295c3ae40f13c53e5f8e2bba8137c50aa2e043b Mon Sep 17 00:00:00 2001 From: Dave Dalcino Date: Sat, 2 Apr 2022 14:49:23 -0700 Subject: [PATCH 3/8] Add absolutely necessary version updates --- README_dependencies.md | 34 +++++++++++++++++++++++++--------- 1 file changed, 25 insertions(+), 9 deletions(-) diff --git a/README_dependencies.md b/README_dependencies.md index 51bc71a6..1f9cd2b3 100644 --- a/README_dependencies.md +++ b/README_dependencies.md @@ -29,18 +29,23 @@ RefreshEnv.cmd # reload the environment ``` ### Necessary Dependencies -1. A C++ compiler that supports C++17. +1. A C++ compiler that supports C++20. See [cppreference.com](https://en.cppreference.com/w/cpp/compiler_support) to see which features are supported by each compiler. The following compilers should work: - * [gcc 7+](https://gcc.gnu.org/) + * [gcc 11+](https://gcc.gnu.org/)
Install command - - Debian/Ubuntu: + - Ubuntu 21.04+: + + sudo apt install gcc-11 + + - Ubuntu 18.04-20.04: - sudo apt install build-essential + sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test && sudo apt-get update -qq + sudo apt install gcc-11 - Windows: @@ -51,7 +56,7 @@ The following compilers should work: brew install gcc
- * [clang 6+](https://clang.llvm.org/) + * [clang 13+](https://clang.llvm.org/)
Install command @@ -107,10 +112,15 @@ The following compilers should work:
Install Command - - Via pip - https://docs.conan.io/en/latest/installation.html#install-with-pip-recommended + - Via pip (requires Python 3.5+) - https://docs.conan.io/en/latest/installation.html#install-with-pip-recommended pip install --user conan + Over time, you may need to upgrade Conan to maintain compatibility with the latest packages. + You can do that with: + + pip install --user --upgrade conan + - Windows: choco install conan -y @@ -121,13 +131,19 @@ The following compilers should work:
-3. [CMake 3.15+](https://cmake.org/) +3. [CMake 3.18+](https://cmake.org/)
Install Command - - Debian/Ubuntu: + - All platforms (if you have Python installed): + + pip install --user cmake + + - Ubuntu 21.04 or later: + + sudo apt-get install cmake cmake-curses-gui - sudo apt-get install cmake + - Ubuntu 16.04-20.04: Follow instructions at [Kitware](https://apt.kitware.com/) - Windows: From 4858f744a87e9ee244f69c86bbb45924cfbb558b Mon Sep 17 00:00:00 2001 From: Dave Dalcino Date: Sat, 2 Apr 2022 14:56:23 -0700 Subject: [PATCH 4/8] Make optional dependencies sound more important Many of the optional dependencies will trigger warnings on build if they are not installed. If they are not strongly encouraged to install these, it is likely that many users will simply ignore them and trigger the warnings. --- README_dependencies.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README_dependencies.md b/README_dependencies.md index 1f9cd2b3..b28a314c 100644 --- a/README_dependencies.md +++ b/README_dependencies.md @@ -155,7 +155,7 @@ The following compilers should work:
-### Optional Dependencies +### Strongly Recommended (but optional) Dependencies #### C++ Tools * [Doxygen](http://doxygen.nl/)
From 7a9bdad7d840e1db7a53f898635baf6b72961296 Mon Sep 17 00:00:00 2001 From: Dave Dalcino Date: Sat, 2 Apr 2022 14:56:48 -0700 Subject: [PATCH 5/8] Warn users about the Conan SDL package --- README_dependencies.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/README_dependencies.md b/README_dependencies.md index b28a314c..9a248f08 100644 --- a/README_dependencies.md +++ b/README_dependencies.md @@ -242,7 +242,10 @@ If you run into difficulty using them, please refer to their documentation, linked here: - [NANA](http://nanapro.org/en-us/documentation/) -- [SDL](http://wiki.libsdl.org/FrontPage) +- [SDL](http://wiki.libsdl.org/FrontPage): + Please note that the Conan package for SDL can be challenging to build on some platforms. + If you need to use SDL, you may find it easier to install using the + [official instructions](http://wiki.libsdl.org/Installation) than to use the Conan package. - [IMGUI](https://github.com/ocornut/imgui/tree/master/docs): This framework depends on SFML, and if you are using Linux, you may need to install several of SFML's dependencies using your package manager. See From 8a0b909b35716a30ca45258a289c55c089a563f0 Mon Sep 17 00:00:00 2001 From: David Dalcino Date: Sun, 3 Apr 2022 08:55:07 -0700 Subject: [PATCH 6/8] Remove discussion of nonexistent dependencies The GUI libraries are in cpp_starter_project, not cpp_boilerplate_project, so they do not need to be discussed here. --- README_dependencies.md | 28 ---------------------------- 1 file changed, 28 deletions(-) diff --git a/README_dependencies.md b/README_dependencies.md index 9a248f08..0ce26e28 100644 --- a/README_dependencies.md +++ b/README_dependencies.md @@ -225,31 +225,3 @@ The following compilers should work: https://github.com/include-what-you-use/include-what-you-use#how-to-install
-#### GUI libraries -This project can be made to work with several optional GUI frameworks. - -If desired, you should install the following optional dependencies as -directed by their documentation, linked here: - -- [FLTK](https://www.fltk.org/doc-1.4/index.html) -- [GTKMM](https://www.gtkmm.org/en/documentation.html) -- [QT](https://doc.qt.io/) - -The following dependencies can be downloaded automatically by CMake and Conan. -All you need to do to install them is to turn on a CMake flag during -configuration. -If you run into difficulty using them, please refer to their documentation, -linked here: - -- [NANA](http://nanapro.org/en-us/documentation/) -- [SDL](http://wiki.libsdl.org/FrontPage): - Please note that the Conan package for SDL can be challenging to build on some platforms. - If you need to use SDL, you may find it easier to install using the - [official instructions](http://wiki.libsdl.org/Installation) than to use the Conan package. -- [IMGUI](https://github.com/ocornut/imgui/tree/master/docs): - This framework depends on SFML, and if you are using Linux, you may need - to install several of SFML's dependencies using your package manager. See - [the SFML build tutorial](https://www.sfml-dev.org/tutorials/2.5/compile-with-cmake.php) - for specifics. - - From c0f0f5b3ba62cfef5d08e3384340a33b1ac8c1c5 Mon Sep 17 00:00:00 2001 From: David Dalcino Date: Sat, 9 Apr 2022 12:30:06 -0700 Subject: [PATCH 7/8] Warn that mingw is unsupported --- README_dependencies.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README_dependencies.md b/README_dependencies.md index 0ce26e28..6917b056 100644 --- a/README_dependencies.md +++ b/README_dependencies.md @@ -49,6 +49,10 @@ The following compilers should work: - Windows: + The most popular Windows port of `gcc` is `mingw`, which you can install with `choco`. + Please be aware that `mingw` is not officially supported by this project, owing to numerous + longstanding bugs. Use it at your own risk. + choco install mingw -y - MacOS: From d6f1a67466267b20fa474402dac684b68430d3d6 Mon Sep 17 00:00:00 2001 From: Template Janitor Date: Sat, 30 Apr 2022 20:57:21 +0000 Subject: [PATCH 8/8] Change Template Name --- .github/template/template_name | 2 +- .github/template/template_repository | 2 +- README.md | 14 +++++++------- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/template/template_name b/.github/template/template_name index 9f9b489e..b4857fcb 100644 --- a/.github/template/template_name +++ b/.github/template/template_name @@ -1 +1 @@ -cpp_boilerplate_project +cmake_conan_boilerplate_template diff --git a/.github/template/template_repository b/.github/template/template_repository index 622fb5a7..efbdeb18 100644 --- a/.github/template/template_repository +++ b/.github/template/template_repository @@ -1 +1 @@ -cpp-best-practices/cpp_boilerplate_project +cpp-best-practices/cmake_conan_boilerplate_template diff --git a/README.md b/README.md index 860389e3..8b9af443 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,11 @@ -# cpp_boilerplate_project +# cmake_conan_boilerplate_template -[![ci](https://github.com/cpp-best-practices/cpp_boilerplate_project/actions/workflows/ci.yml/badge.svg)](https://github.com/cpp-best-practices/cpp_boilerplate_project/actions/workflows/ci.yml) -[![codecov](https://codecov.io/gh/cpp-best-practices/cpp_boilerplate_project/branch/main/graph/badge.svg)](https://codecov.io/gh/cpp-best-practices/cpp_boilerplate_project) -[![Language grade: C++](https://img.shields.io/lgtm/grade/cpp/github/cpp-best-practices/cpp_boilerplate_project)](https://lgtm.com/projects/g/cpp-best-practices/cpp_boilerplate_project/context:cpp) -[![CodeQL](https://github.com/cpp-best-practices/cpp_boilerplate_project/actions/workflows/codeql-analysis.yml/badge.svg)](https://github.com/cpp-best-practices/cpp_boilerplate_project/actions/workflows/codeql-analysis.yml) +[![ci](https://github.com/cpp-best-practices/cmake_conan_boilerplate_template/actions/workflows/ci.yml/badge.svg)](https://github.com/cpp-best-practices/cmake_conan_boilerplate_template/actions/workflows/ci.yml) +[![codecov](https://codecov.io/gh/cpp-best-practices/cmake_conan_boilerplate_template/branch/main/graph/badge.svg)](https://codecov.io/gh/cpp-best-practices/cmake_conan_boilerplate_template) +[![Language grade: C++](https://img.shields.io/lgtm/grade/cpp/github/cpp-best-practices/cmake_conan_boilerplate_template)](https://lgtm.com/projects/g/cpp-best-practices/cmake_conan_boilerplate_template/context:cpp) +[![CodeQL](https://github.com/cpp-best-practices/cmake_conan_boilerplate_template/actions/workflows/codeql-analysis.yml/badge.svg)](https://github.com/cpp-best-practices/cmake_conan_boilerplate_template/actions/workflows/codeql-analysis.yml) -## About cpp_boilerplate_project +## About cmake_conan_boilerplate_template This is a C++ Best Practices GitHub template for getting up and running with C++ quickly. @@ -36,7 +36,7 @@ Ths Boilerplate project will merge new features first, then they will be merged ### Use the Github template First, click the green `Use this template` button near the top of this page. -This will take you to Github's ['Generate Repository'](https://github.com/cpp-best-practices/cpp_boilerplate_project/generate) page. +This will take you to Github's ['Generate Repository'](https://github.com/cpp-best-practices/cmake_conan_boilerplate_template/generate) page. Fill in a repository name and short description, and click 'Create repository from template'. This will allow you to create a new repository in your Github account, prepopulated with the contents of this project.