-
Notifications
You must be signed in to change notification settings - Fork 1
/
CMakeLists.txt
110 lines (98 loc) · 2.7 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
cmake_minimum_required(VERSION 3.12)
project(serial2redis)
add_executable(serial2redis)
add_executable(udp2redis)
add_executable(ws2redis)
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_C_COMPILER gcc)
set(CMAKE_CXX_COMPILER g++)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g ")
set(CMAKE_C_FLAGS "${CMAKE_CXX_FLAGS} -g ")
add_definitions(-DLINUX -std=c++17) # needed 17 for seasocks
set(HIREDIS hiredis )
set(LIMERO /home/lieven/workspace/limero)
set(TINYCBOR tinycbor)
set(ARDUINOJSON /home/lieven/workspace/ArduinoJson/src)
set(SEASOCKS seasocks)
set(SEASOCKS_LDIR ${SEASOCKS}/build/src/main/c)
set(SEASOCKS_INC ${SEASOCKS}/src/main/c)
include_directories(
src
${LIMERO}/linux
${LIMERO}/inc
${HIREDIS}
${ARDUINOJSON}
${SEASOCKS_INC}
${TINYCBOR}/src
)
target_sources(serial2redis PRIVATE
src/serial2redis.cpp
${LIMERO}/linux/ConfigFile.cpp
src/SessionSerial.cpp
src/serial.cpp
${LIMERO}/linux/Redis.cpp
src/Framing.cpp
src/Flows.cpp
${LIMERO}/src/PPP.cpp
${LIMERO}/linux/CborDump.cpp
${LIMERO}/src/CborSerializer.cpp
${LIMERO}/src/CborDeserializer.cpp
${LIMERO}/linux/Log.cpp
${LIMERO}/linux/LogFile.cpp
${LIMERO}/linux/Sys.cpp
${LIMERO}/linux/limero.cpp
${LIMERO}/src/printf.c
${LIMERO}/src/StringUtility.cpp
)
target_sources(ws2redis PRIVATE
src/ws2redis.cpp
src/Flows.cpp
${LIMERO}/linux/CborDump.cpp
${LIMERO}/src/CborSerializer.cpp
${LIMERO}/src/CborDeserializer.cpp
${LIMERO}/linux/ConfigFile.cpp
${LIMERO}/linux/Redis.cpp
${LIMERO}/linux/Log.cpp
${LIMERO}/linux/LogFile.cpp
${LIMERO}/linux/Sys.cpp
${LIMERO}/linux/limero.cpp
${LIMERO}/src/printf.c
${LIMERO}/src/StringUtility.cpp
)
target_sources(udp2redis PRIVATE
src/udp2redis.cpp
src/Flows.cpp
${LIMERO}/linux/Redis.cpp
${LIMERO}/linux/ConfigFile.cpp
src/SessionUdp.cpp
src/Udp.cpp
${LIMERO}/linux/CborDump.cpp
${LIMERO}/src/CborSerializer.cpp
${LIMERO}/src/CborDeserializer.cpp
${LIMERO}/linux/Log.cpp
${LIMERO}/linux/LogFile.cpp
${LIMERO}/linux/Sys.cpp
${LIMERO}/linux/limero.cpp
${LIMERO}/src/StringUtility.cpp
${LIMERO}/src/printf.c
)
target_link_libraries(serial2redis
-lpthread
-L../${HIREDIS}/build -l:libhiredis.a
-L../${TINYCBOR}/lib -l:libtinycbor.a
-lrt
-latomic)
target_link_libraries(ws2redis
-lpthread
-L../${SEASOCKS_LDIR} -l:libseasocks.a
-lz
-L../${HIREDIS}/build -l:libhiredis.a
-L../${TINYCBOR}/lib -l:libtinycbor.a
-lrt
-latomic)
target_link_libraries(udp2redis
-lpthread
-L../${HIREDIS}/build -l:libhiredis.a
-L../${TINYCBOR}/lib -l:libtinycbor.a
-lrt
-latomic)