-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathCMakeLists.txt
38 lines (29 loc) · 1.01 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
cmake_minimum_required(VERSION 3.7)
PROJECT(Bakup_Agent)
set(BINARY ${CMAKE_PROJECT_NAME})
# Set DEBUG to false if it is not passed as a parameter
set(DEBUG FALSE CACHE BOOL "")
message("DEBUG MODE: " ${DEBUG})
set(CMAKE_CXX_STANDARD 17)
cmake_policy(SET CMP0079 NEW)
include_directories(src)
set(USE_SYSTEM_CURL ON CACHE BOOL OFF FORCE)
set(BUILD_CPR_TESTS OFF CACHE BOOL OFF FORCE)
add_subdirectory(include/cpr)
set(RAPIDJSON_BUILD_TESTS OFF CACHE BOOL OFF FORCE)
add_subdirectory(include/rapidjson)
include_directories(include/rapidjson/include)
# If DEBUG is true, include the googletest subdirectory
# Must come before related test files as they are dependent on this
if(DEBUG)
add_subdirectory(include/googletest)
endif()
add_subdirectory(src)
target_link_libraries(${BINARY} PRIVATE cpr)
target_link_libraries(${BINARY}_lib PRIVATE cpr)
if(DEBUG)
target_link_libraries(${BINARY}_lib PUBLIC gtest)
add_subdirectory(tests)
target_link_libraries(${BINARY}_tst PRIVATE cpr)
enable_testing()
endif()