-
Notifications
You must be signed in to change notification settings - Fork 4
/
CMakeLists.txt
50 lines (34 loc) · 1.16 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
cmake_minimum_required(VERSION 3.14)
project(banana)
include(FetchContent)
set(BANANA_VERSION_MAJOR 0)
set(BANANA_VERSION_MINOR 5)
set(BANANA_VERSION_PATCH 0)
set(BANANA_ROOT_DIR ${PROJECT_SOURCE_DIR})
# === Configuration options ===
option(BANANA_USE_BUNDLED_CPR "Use CPR submodule for CPR agent" OFF)
option(BANANA_BUILD_EXAMPLES "Build banana examples" OFF)
# === Configuration logging ===
message(STATUS "[banana] Use bundled CPR: ${BANANA_USE_BUNDLED_CPR}")
message(STATUS "[banana] Build examples: ${BANANA_BUILD_EXAMPLES}")
# TODO: replace with raw curl?
if(BANANA_USE_BUNDLED_CPR)
# Don't build cpr tests
set(BUILD_CPR_TESTS OFF CACHE BOOL "" FORCE)
find_package(CURL)
if(CURL_FOUND)
# Use the system curl for faster builds
set(USE_SYSTEM_CURL ON CACHE BOOL "" FORCE)
endif()
FetchContent_Declare(cpr
GIT_REPOSITORY https://github.com/whoshuu/cpr.git
GIT_TAG f4622efcb59d84071ae11404ae61bd821c1c344b
)
FetchContent_MakeAvailable(cpr)
endif()
# === Library ===
add_subdirectory(source)
# === Testing ===
if (${PROJECT_SOURCE_DIR} STREQUAL ${CMAKE_SOURCE_DIR})
add_subdirectory(tests)
endif()