-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
48 lines (34 loc) · 1 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
cmake_minimum_required(VERSION 3.10...3.30)
project(
uboat
VERSION 0.0.1
DESCRIPTION ""
LANGUAGES CXX)
set(CMAKE_CXX_STANDARD 23)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
option(UBOAT_BUILD_TESTING "Build the testing tree." OFF)
# for testing
include(CTest)
# libraries nlohmann::json for json parsing
find_package(nlohmann_json 3.2.0 REQUIRED)
# openssl
find_package(OpenSSL REQUIRED)
# cpr for http(s) request
include(FetchContent)
FetchContent_Declare(
cpr
GIT_REPOSITORY https://github.com/libcpr/cpr.git
GIT_TAG 1.10.5)
FetchContent_MakeAvailable(cpr)
include_directories(include)
add_subdirectory(examples)
set(SRC_LIST src/uboat.cpp)
# add directory for unit tests
if(UBOAT_BUILD_TESTING)
message(STATUS "Building of tests is enabled.")
enable_testing()
add_subdirectory(tests)
endif()
add_library(${CMAKE_PROJECT_NAME} ${SRC_LIST})
target_link_libraries(${CMAKE_PROJECT_NAME} PRIVATE nlohmann_json::nlohmann_json
cpr::cpr OpenSSL::Crypto)