|
1 | 1 | # CPP20-Cross-Platform-Template |
2 | | -A template for a cross-platform C++20 project including CMake, unit-testing with Catch, cross-platform CI with Travis-CI/Github Actions and cross-platform release builds using Github Actions. |
| 2 | +A template for a cross-platform C++20 project including modern CMake, unit-testing with Catch, cross-platform CI and release builds using using Github Actions. |
3 | 3 |
|
4 | 4 | ## What's included |
5 | 5 | - CMake C++20 project skeleton, with strict warning flags enabled when using GCC or Clang. |
| 6 | +- Usage of modern CMake practices for setting project-wide compiler options, etc. in a target-focused way. |
| 7 | +- Properly exported CMake project that can be used by other CMake projects with minimal effort (no hand-written `FindMyProject.cmake` files) |
6 | 8 | - Unit testing using [Catch2](https://github.com/catchorg/Catch2), with automatic test discovery integration with CTest. |
7 | | -- Travis-CI config file supporting building and running tests on Linux, macOS and Windows using the following compilers: |
| 9 | +- Github Actions config files supporting building and running tests on Linux, macOS and Windows using the following compilers: |
8 | 10 | - Linux: GCC-10, Clang-10 |
9 | | - - macOS: Clang-10 |
| 11 | + - macOS: GCC-10, Clang-12 |
10 | 12 | - Windows: MSVC 2019 |
11 | | - - 1 Additional build on Linux to check Doxygen documentation is well-formed |
12 | | -- Github Action config file supporting: |
13 | | - - Building and running tests on the same Operating Systems and Compilers as Travis-CI (additionally, GCC-10 on macOS) |
14 | | - - Building Releases on each platform when a Github Release is published, uploading these as build Artifacts. |
| 13 | +- Building Releases on each platform when a Github Release is published, uploading these as build Artifacts. |
15 | 14 | - Doxygen config file with tweaks from the default config settings to provide a few more graphs (usage, caller/callee relationships) than are enabled by default. |
16 | 15 |
|
| 16 | +> **Note** There's also a Travis-CI build config for a cross-platform build of similar structure to the Github Actions builds, however this is no longer maintained as Travis-CI has been found to not support more recent versions of CMake on all platforms. |
| 17 | +
|
17 | 18 | ## Usage |
18 | 19 | 1. Click the <kbd>Use this template</kbd> button at the top of this page to create your own new copy of this template |
19 | 20 | 2. Fill in the project details on the next page as you desire |
20 | 21 | 3. Once you've got your new project produced from this template, make changes in the following files: |
21 | | - - `CMakeLists.txt`: |
22 | | - - Replace all instances of `PROJ` or `proj` with your project's name, capitalised or uncapitalised as appropriate |
| 22 | + - `CMakeLists.txt`, `project/CMakeLists.txt`, `project/src/CMakeLists.txt`, `tests/CMakeLists.txt`: |
| 23 | + - Replace all instances of `PROJECT`, `project` and `Project` with your project's name, capitalised or uncapitalised as appropriate |
23 | 24 | - `Doxyfile`: |
24 | 25 | - Change the `PROJECT_NAME` and `INPUT` settings to your project's name. |
25 | | - - `proj`: |
| 26 | + - `project`: |
26 | 27 | - Rename this directory to the name of your project. |
| 28 | + - **Choose a Software License for your code** if it is open-source and you want other people to be able to use it with ease! |
| 29 | + |
| 30 | + This _project template_ is placed into the public domain, but you may want to use a different license for your own projects that you create from this template. Here is the public domain dedication text for this project: |
| 31 | + |
| 32 | + ``` |
| 33 | + This is free and unencumbered software released into the public domain. |
| 34 | +
|
| 35 | + Anyone is free to copy, modify, publish, use, compile, sell, or |
| 36 | + distribute this software, either in source code form or as a compiled |
| 37 | + binary, for any purpose, commercial or non-commercial, and by any |
| 38 | + means. |
| 39 | +
|
| 40 | + In jurisdictions that recognize copyright laws, the author or authors |
| 41 | + of this software dedicate any and all copyright interest in the |
| 42 | + software to the public domain. We make this dedication for the benefit |
| 43 | + of the public at large and to the detriment of our heirs and |
| 44 | + successors. We intend this dedication to be an overt act of |
| 45 | + relinquishment in perpetuity of all present and future rights to this |
| 46 | + software under copyright law. |
| 47 | +
|
| 48 | + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, |
| 49 | + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF |
| 50 | + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. |
| 51 | + IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR |
| 52 | + OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, |
| 53 | + ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR |
| 54 | + OTHER DEALINGS IN THE SOFTWARE. |
| 55 | +
|
| 56 | + For more information, please refer to <http://unlicense.org/> |
| 57 | + ``` |
27 | 58 | 4. Enjoy! |
28 | 59 |
|
29 | 60 | > The above instructions are the bare minimum required to get your own project based on this template off of the ground. You'll almost certainly want to change more things in `Doxyfile` and definitely `README.md`, but that should be well within the capabilities of a developer and also beyond the scope of this guide. |
0 commit comments