-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
137 lines (115 loc) · 4.49 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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
cmake_minimum_required(VERSION 2.8.11)
if(WIN32)
SET(CSI_INCLUDE_PATH
${CMAKE_SOURCE_DIR}/../include
${CMAKE_SOURCE_DIR}/../zlib
${CMAKE_SOURCE_DIR}/../zlib/build
${CMAKE_SOURCE_DIR}/../lz4/lib
${CMAKE_SOURCE_DIR}/../openssl/include
${CMAKE_SOURCE_DIR}/../boost
${CMAKE_SOURCE_DIR}/../csi-kafka
${CMAKE_SOURCE_DIR}/../csi-async
${CMAKE_SOURCE_DIR}/../csi-hcl-asio
${CMAKE_SOURCE_DIR}/../curl/include
)
SET(CSI_LIBRARY_PATH
${CMAKE_SOURCE_DIR}/../openssl
${CMAKE_SOURCE_DIR}/../zlib/build
${CMAKE_SOURCE_DIR}/../boost/stage/lib/$(Platform)/lib
${CMAKE_SOURCE_DIR}/../lib/$(Platform)
${CMAKE_SOURCE_DIR}/../curl/lib/$(Platform)
${CMAKE_SOURCE_DIR}/../csi-kafka/lib/$(Platform)
)
SET(LIBRARY_OUTPUT_PATH ${CMAKE_SOURCE_DIR}/lib/$(Platform))
SET(EXECUTABLE_OUTPUT_PATH ${CMAKE_SOURCE_DIR}/bin/$(Platform))
add_definitions(-D_FILE_OFFSET_BITS=64 -D_REENTRANT -DEXTERNAL_LOCKS -DMULTITHREAD)
add_definitions(-DBOOST_ASIO_HAS_STD_CHRONO)
add_definitions(-DMARCH_x86_64)
add_definitions(-D_WIN32_WINNT=0x0602) # win8.1 to get nthll 64 bit
add_definitions(-DWINVER=0x0601)
add_definitions(-DCF_WINDOWS)
add_definitions(/MP)
add_definitions(/bigobj)
add_definitions(-D_UNICODE)
add_definitions(-DUNICODE)
add_definitions(-D_CRT_SECURE_NO_WARNINGS)
add_definitions(-D_SCL_SECURE_NO_WARNINGS)
add_definitions(-DSECURITY_WIN32)
add_definitions(/wd4996) #'strdup': The POSIX name for this item is deprecated
add_definitions(/wd4197) # 'cf_atomic32' : top-level volatile in cast is ignored
add_definitions(/wd4200) #nonstandard extension used : zero-sized array in struct/union
add_definitions(-DBOOST_ALL_STATIC_LINK)
add_definitions(-DCURL_STATICLIB)
SET(ZLIB_LIBS debug zlibstaticd optimized zlibstatic)
SET(KAFKA_LIBS csi-kafka)
#SET(SSL_LIBS libssl libcrypto)
SET(EXT_LIBS ${KAFKA_LIBS} libcurl ${SSL_LIBS} ${ZLIB_LIBS} crypt32 Ws2_32 legacy_stdio_definitions)
elseif(APPLE)
SET(CSI_INCLUDE_PATH
${CMAKE_SOURCE_DIR}/../csi-kafka
${CMAKE_SOURCE_DIR}/../csi-async
${CMAKE_SOURCE_DIR}/../csi-hcl-asio
)
SET(CSI_LIBRARY_PATH
${CMAKE_SOURCE_DIR}/../csi-kafka/lib
)
add_definitions(-DBOOST_LOG_DYN_LINK)
add_definitions(-std=c++11)
set(BOOST_LIBS boost_log_setup boost_log-mt boost_date_time boost_timer boost_thread-mt boost_system boost_program_options boost_filesystem boost_regex boost_chrono boost_iostreams pthread c)
SET(KAFKA_LIBS csi-kafka)
SET(EXT_LIBS ${KAFKA_LIBS} ${BOOST_LIBS} curl crypto ssl)
elseif(ALPINE_LINUX)
SET(CSI_INCLUDE_PATH
${CMAKE_SOURCE_DIR}/../csi-kafka
${CMAKE_SOURCE_DIR}/../csi-async
${CMAKE_SOURCE_DIR}/../csi-hcl-asio
)
SET(CSI_LIBRARY_PATH
${CMAKE_SOURCE_DIR}/../csi-kafka/lib
)
set(LIBRARY_OUTPUT_PATH ${CMAKE_SOURCE_DIR}/lib)
SET(EXECUTABLE_OUTPUT_PATH ${CMAKE_SOURCE_DIR}/bin)
add_definitions(-D_FILE_OFFSET_BITS=64 -D_REENTRANT -DEXTERNAL_LOCKS -DMULTITHREAD)
add_definitions(-fPIC)
add_definitions(-std=c++11)
add_definitions(-DBOOST_LOG_DYN_LINK)
add_definitions(-DBOOST_ALL_DYN_LINK)
add_definitions(-Wno-deprecated)
#boost_thread
set(BOOST_LIBS boost_log_setup-mt boost_log-mt boost_date_time-mt boost_timer-mt boost_thread-mt boost_system-mt boost_program_options-mt boost_filesystem-mt boost_regex-mt boost_chrono-mt boost_iostreams-mt pthread rt c)
SET(KAFKA_LIBS csi-kafka)
SET(EXT_LIBS ${KAFKA_LIBS} ${BOOST_LIBS} curl crypto ssl)
else()
#LINUX
SET(CSI_INCLUDE_PATH
${CMAKE_SOURCE_DIR}/../csi-kafka
${CMAKE_SOURCE_DIR}/../csi-async
${CMAKE_SOURCE_DIR}/../csi-hcl-asio
${CMAKE_SOURCE_DIR}/../boost
)
SET(CSI_LIBRARY_PATH
${CMAKE_SOURCE_DIR}/../csi-kafka/lib
${CMAKE_SOURCE_DIR}/../boost/stage/lib
)
set(LIBRARY_OUTPUT_PATH ${CMAKE_SOURCE_DIR}/lib)
SET(EXECUTABLE_OUTPUT_PATH ${CMAKE_SOURCE_DIR}/bin)
add_definitions(-D_FILE_OFFSET_BITS=64 -D_REENTRANT -DEXTERNAL_LOCKS -DMULTITHREAD)
add_definitions(-fPIC)
add_definitions(-std=c++11)
add_definitions(-DBOOST_LOG_DYN_LINK)
add_definitions(-Wno-deprecated)
set(BOOST_LIBS boost_log_setup boost_log boost_date_time boost_timer boost_thread boost_system boost_program_options boost_filesystem boost_regex boost_chrono boost_iostreams pthread rt c)
SET(KAFKA_LIBS csi-kafka)
SET(EXT_LIBS ${KAFKA_LIBS} ${BOOST_LIBS} curl crypto ssl)
endif()
include_directories(${CSI_INCLUDE_PATH} ${CMAKE_SOURCE_DIR})
link_directories(${CSI_LIBRARY_PATH})
#dirty fix to complile non supported static lib on windows...
if(WIN32)
file(GLOB liblz4_files
${CMAKE_CURRENT_SOURCE_DIR}/../lz4/lib/*.c
${CMAKE_CURRENT_SOURCE_DIR}/../lz4/lib/*.h
)
add_library(lz4 STATIC ${liblz4_files})
endif()
add_subdirectory(src)