From 6964d48c970e5f7b11897096c816271785af23ac Mon Sep 17 00:00:00 2001 From: HampusM Date: Sun, 27 Feb 2022 16:07:30 +0100 Subject: build: add fmt library dependency --- CMakeLists.txt | 2 +- lib/CMakeLists.txt | 8 ++++++++ lib/fmt/CMakeLists.txt | 3 +++ src/CMakeLists.txt | 4 ++-- 4 files changed, 14 insertions(+), 3 deletions(-) create mode 100644 lib/fmt/CMakeLists.txt diff --git a/CMakeLists.txt b/CMakeLists.txt index 481d035..66bad3a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,7 +1,7 @@ cmake_minimum_required(VERSION 3.2.0) set(CMAKE_EXPORT_COMPILE_COMMANDS 1) -set(CMAKE_CXX_STANDARD 17) +set(CMAKE_CXX_STANDARD 20) set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}) diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt index 16c32fd..58dfd29 100644 --- a/lib/CMakeLists.txt +++ b/lib/CMakeLists.txt @@ -7,3 +7,11 @@ FetchContent_Declare( ) add_subdirectory(ctre) + +FetchContent_Declare( + fmt + GIT_REPOSITORY "https://github.com/fmtlib/fmt" + GIT_TAG 8.1.1 +) + +add_subdirectory(fmt) diff --git a/lib/fmt/CMakeLists.txt b/lib/fmt/CMakeLists.txt new file mode 100644 index 0000000..d3f9f25 --- /dev/null +++ b/lib/fmt/CMakeLists.txt @@ -0,0 +1,3 @@ +message(STATUS "Fetching fmt...") + +FetchContent_MakeAvailable(fmt) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 7e668ed..a32942b 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -21,7 +21,7 @@ file(GLOB SOURCES add_executable(${PROJECT_NAME} ${SOURCES}) -target_compile_features(${PROJECT_NAME} PUBLIC cxx_std_17) +target_compile_features(${PROJECT_NAME} PUBLIC cxx_std_20) target_compile_options( ${PROJECT_NAME} @@ -40,6 +40,6 @@ target_compile_options( target_include_directories(${PROJECT_NAME} PRIVATE .) -target_link_libraries_system(${PROJECT_NAME} ctre) +target_link_libraries_system(${PROJECT_NAME} ctre fmt) target_link_options(${PROJECT_NAME} PRIVATE -fsanitize=address) -- cgit v1.2.3-18-g5258