From d9210698c9b53539b4737211f4c8f2f378eb9787 Mon Sep 17 00:00:00 2001 From: ClausKlein Date: Wed, 17 Feb 2021 13:16:45 +0100 Subject: [PATCH] update README update CPM.cmake to version 0.30.0 --- .github/workflows/documentation.yaml | 4 ++-- README.md | 6 ++++-- cmake/CPM.cmake | 2 +- documentation/CMakeLists.txt | 2 ++ 4 files changed, 9 insertions(+), 5 deletions(-) diff --git a/.github/workflows/documentation.yaml b/.github/workflows/documentation.yaml index 8b12266..5d5e69a 100644 --- a/.github/workflows/documentation.yaml +++ b/.github/workflows/documentation.yaml @@ -22,12 +22,12 @@ jobs: - name: Install dependencies run: | - brew install doxygen + brew install doxygen graphviz pip3 install jinja2 Pygments - name: Build run: | - cmake -Sdocumentation -Bbuild + cmake -S documentation -B build cmake --build build --target GenerateDocs - name: Publish diff --git a/README.md b/README.md index 500c5e5..b842271 100644 --- a/README.md +++ b/README.md @@ -17,6 +17,8 @@ This template is the result of learnings from many previous projects and should ## Features - [Modern CMake practices](https://pabloariasal.github.io/2018/02/19/its-time-to-do-cmake-right/) +- [CMake for library authors: Best practice](https://crascit.com/2019/10/16/cppcon-2019-deep-cmake-for-library-authors/) +- [Modernize C++ using clang-tidy](https://www.kdab.com/clang-tidy-part-1-modernize-source-code-using-c11c14/) - Suited for single header libraries and projects of any scale - Clean separation of library and executable code - Integrated test suite @@ -41,7 +43,7 @@ This template is the result of learnings from many previous projects and should Eventually, you can remove any unused files, such as the standalone directory or irrelevant github workflows for your project. Feel free to replace the License with one suited for your project. -To cleanly separate the library and subproject code, the outer `CMakeList.txt` only defines the library itself while the tests and other subprojects are self-contained in their own directories. +To cleanly separate the library and subproject code, the outer `CMakeList.txt` only defines the library itself while the tests and other subprojects are self-contained in their own directories. During development it is usually convenient to [build all subprojects at once](#build-everything-at-once). ### Build and run the standalone target @@ -63,7 +65,7 @@ cmake -Htest -Bbuild/test cmake --build build/test CTEST_OUTPUT_ON_FAILURE=1 cmake --build build/test --target test -# or simply call the executable: +# or simply call the executable: ./build/test/GreeterTests ``` diff --git a/cmake/CPM.cmake b/cmake/CPM.cmake index 73ee2d0..7a3d67d 100644 --- a/cmake/CPM.cmake +++ b/cmake/CPM.cmake @@ -1,4 +1,4 @@ -set(CPM_DOWNLOAD_VERSION 0.28.4) +set(CPM_DOWNLOAD_VERSION 0.30.0) if(CPM_SOURCE_CACHE) # Expand relative path. This is important if the provided path contains a tilde (~) diff --git a/documentation/CMakeLists.txt b/documentation/CMakeLists.txt index 18c999e..400d1da 100644 --- a/documentation/CMakeLists.txt +++ b/documentation/CMakeLists.txt @@ -7,6 +7,8 @@ project(GreeterDocs) include(../cmake/CPM.cmake) CPMUsePackageLock(package-lock.cmake) +include(../cmake/options.cmake) + CPMAddPackage(NAME Greeter SOURCE_DIR ${CMAKE_CURRENT_LIST_DIR}/..) CPMAddPackage(