/
CMakeLists.txt
71 lines (58 loc) · 2.83 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
68
69
70
cmake_minimum_required (VERSION 2.6)
project (KRAKENAPI)
#-------------------------------------------------------------------------------
# Control CMAKE_BUILD_TYPE, default: Debug
#-------------------------------------------------------------------------------
if (NOT CMAKE_BUILD_TYPE)
set (CMAKE_BUILD_TYPE "Debug" CACHE string "Build type" FORCE)
endif (NOT CMAKE_BUILD_TYPE)
message (STATUS "Build type: " ${CMAKE_BUILD_TYPE})
#-------------------------------------------------------------------------------
# Find OpenSSL
#-------------------------------------------------------------------------------
find_package (OpenSSL REQUIRED)
include_directories (${OPENSSL_INCLUDE_DIR})
list(APPEND LIBS ${OPENSSL_LIBRARIES})
#-------------------------------------------------------------------------------
# Find CURL
#-------------------------------------------------------------------------------
find_package (CURL REQUIRED)
include_directories (${CURL_INCLUDE_DIR})
list(APPEND LIBS ${CURL_LIBRARIES})
#-------------------------------------------------------------------------------
# Add library kapi (krakenapi)
#-------------------------------------------------------------------------------
aux_source_directory(kraken KAPI_FILES)
add_library (kapi STATIC ${KAPI_FILES})
# set some properties when CMAKE_BUILD_TYPE is "Debug"
set_target_properties (kapi PROPERTIES
COMPILE_DEFINITIONS_DEBUG "JSON_DEBUG;JSON_SAFE"
DEBUG_POSTFIX "d")
list (APPEND LIBS kapi)
#-------------------------------------------------------------------------------
# Add library libjson
#-------------------------------------------------------------------------------
set (LIBJSON_SOURCE_DIR ${CMAKE_HOME_DIRECTORY}/libjson/_internal/Source)
aux_source_directory (${LIBJSON_SOURCE_DIR} LIBJSON_SOURCE_FILES)
add_library (libjson STATIC ${LIBJSON_SOURCE_FILES})
# remove "lib" prefix from the name of the libjson archive
set_target_properties (libjson PROPERTIES PREFIX "")
# set some properties when CMAKE_BUILD_TYPE is "Debug"
set_target_properties (libjson PROPERTIES
COMPILE_DEFINITIONS_DEBUG "JSON_DEBUG;JSON_SAFE"
DEBUG_POSTFIX "d")
list (APPEND LIBS libjson)
#-------------------------------------------------------------------------------
# Add the executable 'kph'
#-------------------------------------------------------------------------------
add_executable (kph kph.cpp)
set_target_properties (kph PROPERTIES
COMPILE_DEFINITIONS_DEBUG "JSON_DEBUG;JSON_SAFE")
target_link_libraries (kph ${LIBS})
#-------------------------------------------------------------------------------
# Add the executable 'krt'
#-------------------------------------------------------------------------------
add_executable (krt krt.cpp)
set_target_properties (krt PROPERTIES
COMPILE_DEFINITIONS_DEBUG "JSON_DEBUG;JSON_SAFE")
target_link_libraries (krt ${LIBS})