-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
68 lines (55 loc) · 1.41 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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
cmake_minimum_required (VERSION 2.8)
option (USE_CLANG "Using clang/clang++" ON)
option (USE_GCC "Using gcc/g++" OFF)
option (DEBUG "Debug Build" ON)
option (TESTS "Test Suite" ON)
if(USE_CLANG)
set (CMAKE_CXX_COMPILER clang++)
set (CMAKE_C_COMPILER clang)
elseif(USE_GCC)
set (CMAKE_CXX_COMPILER g++)
set (CMAKE_C_COMPILER gcc)
endif(USE_CLANG)
project(tent-client-cpp)
set(Boost_COMPONENTS
system
regex
date_time
thread
filesystem
program_options
chrono)
find_package( Boost 1.51.0 REQUIRED ${Boost_COMPONENTS})
if(DEBUG)
set(CMAKE_CXX_FLAGS "-std=c++11 -g3 -ggdb -Wall")
else(DEBUG)
set(CMAKE_CXX_FLAGS "-std=c++11 -w")
endif(DEBUG)
if(TESTS)
add_subdirectory(tests)
endif(TESTS)
# Source
include_directories(src)
file(GLOB_RECURSE tent_client_source
"src/*.cpp"
"src/*.c"
)
# Vendor
include_directories(vendor/cpp-netlib-0.10.1)
include_directories(vendor/rapidjson/include)
include_directories(${Boost_INCLUDE_DIRS})
include(ExternalProject)
ExternalProject_Add(cppnetlib
# URL ""
SOURCE_DIR "${tent-client-cpp_SOURCE_DIR}/vendor/cpp-netlib-0.10.1"
BUILD_IN_SOURCE 0
CONFIGURE_COMMAND
BUILD_COMMAND make -j4
INSTALL_COMMAND ""
)
#ExternalProject_Get_Property(cppnetlib INSTALL_DIR)
#set(CPPNL_DIR ${INSTALL_DIR})
add_library(tentcpp
${tent_client_source})
target_link_libraries(tentcpp
${Boost_LIBRARIES})