-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
51 lines (40 loc) · 1.42 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
cmake_minimum_required(VERSION 3.24)
project(raquest)
set(CMAKE_CXX_STANDARD 23)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_EXPORT_COMPILE_COMMAND ON)
if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang" OR CMAKE_CXX_COMPILER_ID STREQUAL
"AppleClang")
# clang v18 needs these to compile std::expected
message(
STATUS "Clang compiler detected. Adding Clang-specific compiler flags.")
set(CMAKE_CXX_FLAGS "-std=c++23 -D__cpp_concepts=202002L")
endif()
include_directories(include)
add_definitions(-DSOME_DEFINITION)
add_subdirectory(src)
enable_testing()
add_subdirectory(tests)
include(FetchContent)
FetchContent_Declare(
CLI11 URL https://github.com/CLIUtils/CLI11/archive/refs/tags/v2.3.2.zip)
FetchContent_Declare(
json
URL https://github.com/nlohmann/json/releases/download/v3.11.3/json.tar.xz)
FetchContent_Declare(
curl
URL https://github.com/curl/curl/releases/download/curl-7_81_0/curl-7.81.0.tar.gz
)
FetchContent_Declare(
googletest
URL https://github.com/google/googletest/archive/refs/tags/release-1.12.1.zip)
FetchContent_Declare(
fmt
GIT_REPOSITORY https://github.com/fmtlib/fmt
GIT_TAG e69e5f977d458f2650bb346dadf2ad30c5320281) # 10.2.1
FetchContent_MakeAvailable(fmt)
# For Windows: Prevent overriding the parent project's compiler/linker settings
set(gtest_force_shared_crt
ON
CACHE BOOL "" FORCE)
FetchContent_MakeAvailable(googletest CLI11 json curl fmt)