-
Notifications
You must be signed in to change notification settings - Fork 21
/
CMakeLists.txt
79 lines (63 loc) · 1.35 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
cmake_minimum_required(VERSION 3.2)
project(alohalytics C CXX)
set(CMAKE_CXX_STANDART 11)
if(APPLE)
set(CMAKE_CXX_FLAGS "-fobjc-arc -std=c++11")
endif()
set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake ${CMAKE_MODULE_PATH})
# Usage:
# make test ARGS="-V"
enable_testing()
get_filename_component(ALOHA_ROOT . ABSOLUTE)
include_directories(${ALOHA_ROOT})
find_package(Threads REQUIRED)
find_package(ZLIB REQUIRED)
add_subdirectory(examples/cpp)
add_subdirectory(examples/server)
add_subdirectory(server)
add_subdirectory(tests)
set(
SRC
src/alohalytics.h
src/event_base.h
src/file_manager.h
src/gzip_wrapper.h
src/http_client.h
src/location.h
src/logger.h
src/messages_queue.h
src/cpp/alohalytics.cc
examples/cpp/example.cc
)
set(
PLATFORM_SRC
src/posix/file_manager_posix_impl.cc
)
if(UNIX AND NOT APPLE)
add_executable(
${PROJECT_NAME}
${SRC}
${PLATFORM_SRC}
src/posix/http_client_curl.cc
)
endif()
if(APPLE)
set(
OBJECTIVE_SRC
src/alohalytics_objc.h
src/apple/http_client_apple.mm
src/apple/alohalytics_objc.mm
)
add_executable(
${PROJECT_NAME}
${SRC}
${PLATFORM_SRC}
${OBJECTIVE_SRC}
)
target_link_libraries(
${PROJECT_NAME}
"-framework Foundation"
"-framework SystemConfiguration"
)
endif()
target_link_libraries(${PROJECT_NAME} ZLIB::ZLIB Threads::Threads)