Skip to content

update most package used #120

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion .clang-format
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
---
BasedOnStyle: LLVM
Language: Json
IndentWidth: 4
UseTab: Never
---
Language: Cpp
AccessModifierOffset: -2
AlignAfterOpenBracket: DontAlign
AlignConsecutiveAssignments: false
Expand Down Expand Up @@ -69,7 +76,6 @@ IndentWrappedFunctionNames: true
JavaScriptQuotes: Leave
JavaScriptWrapImports: true
KeepEmptyLinesAtTheStartOfBlocks: true
Language: Cpp
MacroBlockBegin: ''
MacroBlockEnd: ''
MaxEmptyLinesToKeep: 2
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.21)
cmake_minimum_required(VERSION 3.21...4.1)

# This template attempts to be "fetch_content"-able
# so that it works well with tools like CPM or other
Expand Down
71 changes: 69 additions & 2 deletions CMakePresets.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,19 @@
"hidden": true,
"generator": "Ninja",
"binaryDir": "${sourceDir}/out/build/${presetName}",
"installDir": "${sourceDir}/out/install/${presetName}"
"installDir": "${sourceDir}/out/install/${presetName}",
"cacheVariables": {
"CMAKE_PREFIX_PATH": {
"type": "path",
"value": "${sourceDir}/out/install/${presetName}"
},
"CMAKE_CXX_EXTENSIONS": false,
"CMAKE_CXX_STANDARD": "23",
"CMAKE_CXX_STANDARD_REQUIRED": true,
"CMAKE_EXPORT_COMPILE_COMMANDS": true,
"CMAKE_MESSAGE_LOG_LEVEL": "TRACE",
"CMAKE_SKIP_TEST_ALL_DEPENDENCY": false
}
},
{
"name": "conf-windows-common",
Expand Down Expand Up @@ -50,6 +62,9 @@
"Darwin"
]
},
"cacheVariables": {
"CMAKE_UNITY_BUILD": true
},
"vendor": {
"microsoft.com/VisualStudioRemoteSettings/CMake/1.0": {
"sourceDir": "$env{HOME}/.vs/$ms{projectDirName}"
Expand Down Expand Up @@ -142,6 +157,8 @@
"description": "Target Unix-like OS with the gcc compiler, debug build type",
"inherits": "conf-unixlike-common",
"cacheVariables": {
"myproject_ENABLE_COVERAGE": false,
"CMAKE_SKIP_INSTALL_RULES": true,
"CMAKE_C_COMPILER": "gcc",
"CMAKE_CXX_COMPILER": "g++",
"CMAKE_BUILD_TYPE": "Debug"
Expand All @@ -164,6 +181,8 @@
"description": "Target Unix-like OS with the clang compiler, debug build type",
"inherits": "conf-unixlike-common",
"cacheVariables": {
"myproject_ENABLE_COVERAGE": false,
"CMAKE_SKIP_INSTALL_RULES": true,
"CMAKE_C_COMPILER": "clang",
"CMAKE_CXX_COMPILER": "clang++",
"CMAKE_BUILD_TYPE": "Debug"
Expand All @@ -181,6 +200,54 @@
}
}
],
"buildPresets":[
{
"name": "build-common",
"description": "Build CMake settings that apply to all configurations",
"hidden": true,
"jobs": 4
},
{
"name": "build-windows-msvc-debug-developer-mode",
"inherits": "build-common",
"configurePreset": "windows-msvc-debug-developer-mode"
},
{
"name": "build-windows-msvc-release-developer-mode",
"inherits": "build-common",
"configurePreset": "windows-msvc-release-developer-mode"
},
{
"name": "build-windows-clang-debug",
"inherits": "build-common",
"configurePreset": "windows-clang-debug"
},
{
"name": "build-windows-clang-release",
"inherits": "build-common",
"configurePreset": "windows-clang-release"
},
{
"name": "build-unixlike-gcc-debug",
"inherits": "build-common",
"configurePreset": "unixlike-gcc-debug"
},
{
"name": "build-unixlike-gcc-release",
"inherits": "build-common",
"configurePreset": "unixlike-gcc-release"
},
{
"name": "build-unixlike-clang-debug",
"inherits": "build-common",
"configurePreset": "unixlike-clang-debug"
},
{
"name": "build-unixlike-clang-release",
"inherits": "build-common",
"configurePreset": "unixlike-clang-release"
}
],
"testPresets": [
{
"name": "test-common",
Expand Down Expand Up @@ -251,4 +318,4 @@
"configurePreset": "unixlike-clang-release"
}
]
}
}
6 changes: 3 additions & 3 deletions Dependencies.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@ function(myproject_setup_dependencies)
# already been provided to us by a parent project

if(NOT TARGET fmtlib::fmtlib)
cpmaddpackage("gh:fmtlib/fmt#11.1.4")
cpmaddpackage("gh:fmtlib/fmt#11.2.0")
endif()

if(NOT TARGET spdlog::spdlog)
cpmaddpackage(
NAME
spdlog
VERSION
1.15.2
1.15.3
GITHUB_REPOSITORY
"gabime/spdlog"
OPTIONS
Expand All @@ -33,7 +33,7 @@ function(myproject_setup_dependencies)
endif()

if(NOT TARGET ftxui::screen)
cpmaddpackage("gh:ArthurSonzogni/FTXUI@6.0.2")
cpmaddpackage("gh:ArthurSonzogni/FTXUI@6.1.9")
endif()

if(NOT TARGET tools::tools)
Expand Down
6 changes: 3 additions & 3 deletions ProjectOptions.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,9 @@ macro(myproject_setup_options)
option(myproject_ENABLE_SANITIZER_UNDEFINED "Enable undefined sanitizer" ${SUPPORTS_UBSAN})
option(myproject_ENABLE_SANITIZER_THREAD "Enable thread sanitizer" OFF)
option(myproject_ENABLE_SANITIZER_MEMORY "Enable memory sanitizer" OFF)
option(myproject_ENABLE_UNITY_BUILD "Enable unity builds" OFF)
option(myproject_ENABLE_CLANG_TIDY "Enable clang-tidy" ON)
option(myproject_ENABLE_CPPCHECK "Enable cpp-check analysis" ON)
option(myproject_ENABLE_UNITY_BUILD "Enable unity builds" ON)
option(myproject_ENABLE_CLANG_TIDY "Enable clang-tidy" OFF)
option(myproject_ENABLE_CPPCHECK "Enable cpp-check analysis" OFF)
option(myproject_ENABLE_PCH "Enable precompiled headers" OFF)
option(myproject_ENABLE_CACHE "Enable ccache" ON)
endif()
Expand Down
4 changes: 2 additions & 2 deletions cmake/CPM.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
#
# SPDX-FileCopyrightText: Copyright (c) 2019-2023 Lars Melchior and contributors

set(CPM_DOWNLOAD_VERSION 0.40.8)
set(CPM_HASH_SUM "78ba32abdf798bc616bab7c73aac32a17bbd7b06ad9e26a6add69de8f3ae4791")
set(CPM_DOWNLOAD_VERSION 0.42.0)
set(CPM_HASH_SUM "2020b4fc42dba44817983e06342e682ecfc3d2f484a581f11cc5731fbe4dce8a")

if(CPM_SOURCE_CACHE)
set(CPM_DOWNLOAD_LOCATION "${CPM_SOURCE_CACHE}/cpm/CPM_${CPM_DOWNLOAD_VERSION}.cmake")
Expand Down
26 changes: 16 additions & 10 deletions test/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.15...3.23)
cmake_minimum_required(VERSION 3.21...4.1)

project(CmakeConfigPackageTests LANGUAGES CXX)

Expand All @@ -17,17 +17,23 @@ endif()

# ---- Dependencies ----

include(${Catch2_SOURCE_DIR}/extras/Catch.cmake)
if(Catch2_DIR)
include(${Catch2_DIR}/Catch.cmake)
else()
include(${Catch2_SOURCE_DIR}/extras/Catch.cmake)
endif()

# Provide a simple smoke test to make sure that the CLI works and can display a --help message
add_test(NAME cli.has_help COMMAND intro --help)
if(TARGET intro)
# Provide a simple smoke test to make sure that the CLI works and can display a --help message
add_test(NAME cli.has_help COMMAND intro --help)

# Provide a test to verify that the version being reported from the application
# matches the version given to CMake. This will be important once you package
# your program. Real world shows that this is the kind of simple mistake that is easy
# to make, but also easy to test for.
add_test(NAME cli.version_matches COMMAND intro --version)
set_tests_properties(cli.version_matches PROPERTIES PASS_REGULAR_EXPRESSION "${PROJECT_VERSION}")
# Provide a test to verify that the version being reported from the application
# matches the version given to CMake. This will be important once you package
# your program. Real world shows that this is the kind of simple mistake that is easy
# to make, but also easy to test for.
add_test(NAME cli.version_matches COMMAND intro --version)
set_tests_properties(cli.version_matches PROPERTIES PASS_REGULAR_EXPRESSION "${PROJECT_VERSION}")
endif()

add_executable(tests tests.cpp)
target_link_libraries(
Expand Down
Loading