-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathCMakeLists.txt
131 lines (112 loc) · 4.62 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
cmake_minimum_required (VERSION 2.8.8)
project (wyliodrin-server)
set (WTALK_VERSION_MAJOR 3)
set (WTALK_VERSION_MINOR 21)
# file (WRITE "/etc/wyliodrin/version" "v${WTALK_VERSION_MAJOR}.${WTALK_VERSION_MINOR}\n")
configure_file (
"${PROJECT_SOURCE_DIR}/wtalk_config.h.in"
"${PROJECT_BINARY_DIR}/wtalk_config.h"
)
set (CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules ${CMAKE_MODULE_PATH})
include (GNUInstallDirs)
include (FindPkgConfig)
include (FindEXPAT)
include (FindOpenSSL)
find_package (Threads REQUIRED)
find_package (EXPAT REQUIRED)
find_package (Hiredis REQUIRED)
pkg_check_modules (STROPHE REQUIRED libstrophe)
pkg_check_modules (JANSSON REQUIRED jansson)
pkg_check_modules (FUSE REQUIRED fuse)
pkg_check_modules (CURL REQUIRED libcurl)
pkg_check_modules (EVENT REQUIRED libevent)
include_directories (
${PROJECT_SOURCE_DIR}/libds
${PROJECT_BINARY_DIR}
${FUSE_INCLUDE_DIRS}
${HIREDIS_INCLUDE_DIRS}
${EVENT_INCLUDE_DIRS}
${JANSSON_INCLUDE_DIRS}
${STROPHE_INCLUDE_DIRS}
${EXPAT_INCLUDE_DIRS}
${OPENSSL_INCLUDE_DIR}
${CURL_INCLUDE_DIRS}
)
set (wyliodrind_SRCS
${PROJECT_SOURCE_DIR}/wtalk.c
${PROJECT_SOURCE_DIR}/wxmpp/wxmpp.c
${PROJECT_SOURCE_DIR}/shells/shells.c
${PROJECT_SOURCE_DIR}/wjson/wjson.c
${PROJECT_SOURCE_DIR}/ps/ps.c
${PROJECT_SOURCE_DIR}/make/make.c
${PROJECT_SOURCE_DIR}/files/files.c
${PROJECT_SOURCE_DIR}/communication/communication.c
${PROJECT_SOURCE_DIR}/base64/base64.c
${PROJECT_SOURCE_DIR}/logs/logs.c
${PROJECT_SOURCE_DIR}/cmp/cmp.c
${PROJECT_SOURCE_DIR}/network/network.c
)
add_library (dbs STATIC
${PROJECT_SOURCE_DIR}/libds/treetest.c
${PROJECT_SOURCE_DIR}/libds/listtest.c
${PROJECT_SOURCE_DIR}/libds/maptest.c
${PROJECT_SOURCE_DIR}/libds/heap.c
${PROJECT_SOURCE_DIR}/libds/hashmap.c
${PROJECT_SOURCE_DIR}/libds/vector.c
${PROJECT_SOURCE_DIR}/libds/strutiltest.c
${PROJECT_SOURCE_DIR}/libds/heaptest.c
${PROJECT_SOURCE_DIR}/libds/strutils.c
${PROJECT_SOURCE_DIR}/libds/vectest.c
${PROJECT_SOURCE_DIR}/libds/tree.c
${PROJECT_SOURCE_DIR}/libds/list.c
)
if (DEVICEINTEL)
add_definitions (-DDEVICEINTEL)
pkg_check_modules (MRAA REQUIRED mraa>=0.4.0)
message (INFO "found libmraa version: ${MRAA_VERSION}")
set(FLAGS "-DDEVICEINTEL")
endif ()
add_executable (wyliodrind
${wyliodrind_SRCS}
)
install (TARGETS wyliodrind DESTINATION bin)
add_definitions ("-Wall -DERR -DSHELLS -DFILES -DMAKE -DCOMMUNICATION -DPS -D_FILE_OFFSET_BITS=64")
target_link_libraries (wyliodrind dbs
${CMAKE_THREAD_LIBS_INIT}
${CURL_LIBRARIES}
-lutil
${HIREDIS_LIBRARIES}
${EVENT_LIBRARIES}
${MRAA_LIBRARIES}
${FUSE_LIBRARIES}
${JANSSON_LIBRARIES}
${STROPHE_LIBRARIES}
${EXPAT_LIBRARIES}
${OPENSSL_LIBRARIES}
)
add_subdirectory (hypervisor)
option (RASPBERRYPI "Build for the RaspberryPi." OFF)
option (UDOONEO "Build for the UDOO NEO." OFF)
option (BEAGLEBONEBLACK "Build for the BEAGLEBONEBLACK." OFF)
install (FILES setup/settings_raspberrypi.json DESTINATION /etc/wyliodrin/ PERMISSIONS WORLD_READ)
install (FILES setup/settings_arduinogalileo.json DESTINATION /etc/wyliodrin/ PERMISSIONS WORLD_READ)
install (FILES setup/settings_edison.json DESTINATION /etc/wyliodrin/ PERMISSIONS WORLD_READ)
install (FILES setup/settings_minnowboardmax.json DESTINATION /etc/wyliodrin/ PERMISSIONS WORLD_READ)
install (FILES setup/settings_udooneo.json DESTINATION /etc/wyliodrin/ PERMISSIONS WORLD_READ)
install (FILES setup/settings_beagleboneblack.json DESTINATION /etc/wyliodrin/ PERMISSIONS WORLD_READ)
if (RASPBERRYPI)
install (FILES scripts/setup_wifi_rpi DESTINATION bin/ PERMISSIONS WORLD_READ WORLD_EXECUTE)
install (FILES setup/boardtype_raspberrypi DESTINATION /etc/wyliodrin/ PERMISSIONS WORLD_READ RENAME boardtype)
install (FILES setup/wyliodrin-server-raspberrypi.conf DESTINATION /etc/supervisor/conf.d/ PERMISSIONS WORLD_READ)
install (FILES setup/interfaces_raspberrypi DESTINATION /etc/network/ PERMISSIONS WORLD_READ RENAME interfaces)
endif ()
if (UDOONEO)
install (FILES scripts/setup_wifi_rpi DESTINATION bin/ PERMISSIONS WORLD_READ WORLD_EXECUTE)
install (FILES setup/wyliodrin-server-udooneo.conf DESTINATION /etc/supervisor/conf.d/ PERMISSIONS WORLD_READ)
install (FILES setup/boardtype_udooneo DESTINATION /etc/wyliodrin/ PERMISSIONS WORLD_READ RENAME boardtype)
install (FILES setup/udooer_nopasswd DESTINATION /etc/sudoers.d/ PERMISSIONS WORLD_READ)
endif ()
if (BEAGLEBONEBLACK)
install (FILES setup/wyliodrin-server-beagleboneblack.conf DESTINATION /etc/supervisor/conf.d/ PERMISSIONS WORLD_READ)
install (FILES setup/boardtype_beagleboneblack DESTINATION /etc/wyliodrin/ PERMISSIONS WORLD_READ RENAME boardtype)
endif ()