-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathCMakeLists.txt
93 lines (70 loc) · 2.24 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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
cmake_minimum_required(VERSION 2.8.12) # version provided by Ubuntu 14.04
# for CMake < 3.0; see http://www.cmake.org/cmake/help/v3.0/policy/CMP0042.html
if(POLICY CMP0042)
cmake_policy(SET CMP0042 NEW)
endif()
# These must come before the project directive, won't work otherwise
set(
CMAKE_INSTALL_PREFIX
"${CMAKE_CURRENT_BINARY_DIR}/../bin-libkullo"
CACHE PATH "destination for make install"
)
if(NOT ("${CMAKE_VERSION}" VERSION_LESS "3.1"))
set(CMAKE_INSTALL_MESSAGE LAZY
CACHE STRING "Show messages during install? Lazy means only changed.")
set_property(CACHE CMAKE_INSTALL_MESSAGE
PROPERTY STRINGS "ALWAYS" "LAZY" "NEVER")
endif()
project(libkullo)
set(CMAKE_MODULE_PATH "${CMAKE_MODULE_PATH}" "${CMAKE_CURRENT_LIST_DIR}/../compilescripts/cmake-modules")
include(CompilerSettings)
include(KulloCommon)
list(APPEND CMAKE_FIND_ROOT_PATH "${CMAKE_CURRENT_BINARY_DIR}/..")
find_package(botan REQUIRED
NO_MODULE
PATHS "/bin-botan"
ONLY_CMAKE_FIND_ROOT_PATH
)
### BEGIN feature checks
if(("${CMAKE_SYSTEM_NAME}" STREQUAL Linux) OR ("${CMAKE_SYSTEM_NAME}" STREQUAL Windows))
set(HAS_BREAKPADWRAPPER TRUE)
else()
set(HAS_BREAKPADWRAPPER FALSE)
endif()
if(IOS)
set(TESTS_AS_STATIC_LIB TRUE)
else()
set(TESTS_AS_STATIC_LIB FALSE)
endif()
### END feature checks
### BEGIN external libs
add_subdirectory("../boost" "external/boost")
add_subdirectory("../google-test" "external/google-test")
add_subdirectory("../smartsqlite/src" "external/smartsqlite/src")
### END external libs
### BEGIN internal libs
include_directories(.)
if(HAS_BREAKPADWRAPPER)
add_subdirectory("breakpadwrapper")
endif()
if(ANDROID)
add_subdirectory("jni")
endif()
add_subdirectory("argon2")
add_subdirectory("jsoncpp")
add_subdirectory("kulloclient")
add_subdirectory("nowide")
add_subdirectory("tests")
### END internal libs
if(NOT TESTS_AS_STATIC_LIB)
enable_testing()
# smartsqlite
add_subdirectory("../smartsqlite/test" "external/smartsqlite/test")
add_test("smartsqlite" "external/smartsqlite/test/smartsqlite_tests")
# libkullo
add_test(
"libkullo"
"tests/libkullo_tests" --assets "${CMAKE_CURRENT_SOURCE_DIR}/tests/assets"
)
endif()
install(DIRECTORY cmake/ DESTINATION cmake)