-
Notifications
You must be signed in to change notification settings - Fork 1
/
CMakeLists.txt
130 lines (116 loc) · 6.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
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
# SPDX-FileCopyrightText: 2016-2024 by pi-lar GmbH
# SPDX-License-Identifier: OSL-3.0
# WIP DRAFT
# TODO:
# - add criterion testing
# - add cross platform capabilities
# - add ncurses
# - add convenient find modules for criterion, sodium and ncurses
# - add compilation for example projects
cmake_minimum_required(VERSION 3.25.0)
project(neuropil VERSION 0.1.0)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DDEBUG -DNP_USE_QCBOR -DQCBOR_DISABLE_ENCODE_USAGE_GUARDS -DQCBOR_DISABLE_INDEFINITE_LENGTH_STRINGS -DQCBOR_DISABLE_INDEFINITE_LENGTH_ARRAYS -DQCBOR_DISABLE_PREFERRED_FLOAT -DEV_STANDALONE -DHAVE_SELECT -DHAVE_KQUEUE -DHAVE_SYS_EVENT_H -DHAVE_POLL -DHAVE_EPOLL_CTL -DHAVE_LINUX_AIO_ABI_H -DEV_USE_FLOOR=1 -DEV_USE_4HEAP=1 -D_GNU_SOURCE")
include(CTest)
enable_testing()
include_directories("${CMAKE_CURRENT_SOURCE_DIR}/include")
include_directories("${CMAKE_CURRENT_SOURCE_DIR}/framework")
include_directories("${CMAKE_CURRENT_SOURCE_DIR}/ext_tools")
include_directories("${CMAKE_CURRENT_SOURCE_DIR}/ext_tools/qcbor/inc")
include_directories("/opt/homebrew/include")
link_directories("/opt/homebrew/lib")
include_directories("/opt/homebrew/opt/libsodium/include")
link_directories("/opt/homebrew/opt/libsodium/lib")
add_library(neuropil SHARED
${CMAKE_CURRENT_SOURCE_DIR}/src/neuropil.c
${CMAKE_CURRENT_SOURCE_DIR}/src/neuropil_data.c
${CMAKE_CURRENT_SOURCE_DIR}/src/neuropil_attributes.c
${CMAKE_CURRENT_SOURCE_DIR}/src/dtime.c
${CMAKE_CURRENT_SOURCE_DIR}/src/np_time.c
${CMAKE_CURRENT_SOURCE_DIR}/src/np_aaatoken.c
${CMAKE_CURRENT_SOURCE_DIR}/src/np_axon.c
${CMAKE_CURRENT_SOURCE_DIR}/src/np_dendrit.c
${CMAKE_CURRENT_SOURCE_DIR}/src/np_glia.c
${CMAKE_CURRENT_SOURCE_DIR}/src/np_jobqueue.c
${CMAKE_CURRENT_SOURCE_DIR}/src/np_dhkey.c
${CMAKE_CURRENT_SOURCE_DIR}/src/np_key.c
${CMAKE_CURRENT_SOURCE_DIR}/src/np_keycache.c
${CMAKE_CURRENT_SOURCE_DIR}/src/np_bootstrap.c
${CMAKE_CURRENT_SOURCE_DIR}/src/np_log.c
${CMAKE_CURRENT_SOURCE_DIR}/src/np_memory.c
${CMAKE_CURRENT_SOURCE_DIR}/src/np_message.c
${CMAKE_CURRENT_SOURCE_DIR}/src/np_network.c
${CMAKE_CURRENT_SOURCE_DIR}/src/np_node.c
${CMAKE_CURRENT_SOURCE_DIR}/src/np_pheromones.c
${CMAKE_CURRENT_SOURCE_DIR}/src/np_route.c
${CMAKE_CURRENT_SOURCE_DIR}/src/np_util.c
${CMAKE_CURRENT_SOURCE_DIR}/src/np_threads.c
${CMAKE_CURRENT_SOURCE_DIR}/src/np_evloop.c
${CMAKE_CURRENT_SOURCE_DIR}/src/np_eventqueue.c
${CMAKE_CURRENT_SOURCE_DIR}/src/np_messagepart.c
${CMAKE_CURRENT_SOURCE_DIR}/src/np_statistics.c
${CMAKE_CURRENT_SOURCE_DIR}/src/np_responsecontainer.c
${CMAKE_CURRENT_SOURCE_DIR}/src/np_legacy.c
${CMAKE_CURRENT_SOURCE_DIR}/src/np_shutdown.c
${CMAKE_CURRENT_SOURCE_DIR}/src/np_token_factory.c
${CMAKE_CURRENT_SOURCE_DIR}/src/np_crypto.c
${CMAKE_CURRENT_SOURCE_DIR}/src/core/np_comp_identity.c
${CMAKE_CURRENT_SOURCE_DIR}/src/core/np_comp_msgproperty.c
${CMAKE_CURRENT_SOURCE_DIR}/src/core/np_comp_intent.c
${CMAKE_CURRENT_SOURCE_DIR}/src/core/np_comp_node.c
${CMAKE_CURRENT_SOURCE_DIR}/src/core/np_comp_alias.c
${CMAKE_CURRENT_SOURCE_DIR}/src/util/np_serialization.c
${CMAKE_CURRENT_SOURCE_DIR}/src/util/np_bloom.c
${CMAKE_CURRENT_SOURCE_DIR}/src/util/np_minhash.c
${CMAKE_CURRENT_SOURCE_DIR}/src/util/np_cupidtrie.c
${CMAKE_CURRENT_SOURCE_DIR}/src/util/np_tree.c
${CMAKE_CURRENT_SOURCE_DIR}/src/util/np_treeval.c
${CMAKE_CURRENT_SOURCE_DIR}/src/util/np_scache.c
${CMAKE_CURRENT_SOURCE_DIR}/src/util/np_skiplist.c
${CMAKE_CURRENT_SOURCE_DIR}/src/util/np_statemachine.c
${CMAKE_CURRENT_SOURCE_DIR}/framework/prometheus/prometheus.c
${CMAKE_CURRENT_SOURCE_DIR}/framework/sysinfo/np_sysinfo.c
${CMAKE_CURRENT_SOURCE_DIR}/framework/http/np_http.c
${CMAKE_CURRENT_SOURCE_DIR}/framework/http/urldecode.c
${CMAKE_CURRENT_SOURCE_DIR}/framework/files/file.c
${CMAKE_CURRENT_SOURCE_DIR}/framework/search/np_bktree.c
${CMAKE_CURRENT_SOURCE_DIR}/framework/search/np_index.c
${CMAKE_CURRENT_SOURCE_DIR}/framework/search/np_search.c
${CMAKE_CURRENT_SOURCE_DIR}/framework/identity/np_identity.c
${CMAKE_CURRENT_SOURCE_DIR}/framework/identity/np_keystore.c
${CMAKE_CURRENT_SOURCE_DIR}/ext_tools/event/ev.c
${CMAKE_CURRENT_SOURCE_DIR}/ext_tools/parson/parson.c
${CMAKE_CURRENT_SOURCE_DIR}/ext_tools/msgpack/cmp.c
${CMAKE_CURRENT_SOURCE_DIR}/ext_tools/gpio/bcm2835.c
${CMAKE_CURRENT_SOURCE_DIR}/ext_tools/qcbor/src/UsefulBuf.c
${CMAKE_CURRENT_SOURCE_DIR}/ext_tools/qcbor/src/qcbor_err_to_str.c
${CMAKE_CURRENT_SOURCE_DIR}/ext_tools/qcbor/src/qcbor_decode.c
${CMAKE_CURRENT_SOURCE_DIR}/ext_tools/qcbor/src/qcbor_encode.c)
set(CPACK_PROJECT_NAME ${PROJECT_NAME})
set(CPACK_PROJECT_VERSION ${PROJECT_VERSION})
include(CPack)
add_executable(neuropil_node examples/neuropil_node.c)
add_executable(neuropil_cloud examples/neuropil_cloud.c)
add_executable(neuropil_hydra examples/neuropil_hydra.c)
add_executable(neuropil_controller examples/neuropil_controller.c)
add_executable(neuropil_sender examples/neuropil_sender.c)
add_executable(neuropil_test examples/neuropil_test.c)
add_executable(neuropil_identity examples/neuropil_identity.c)
add_executable(neuropil_receiver examples/neuropil_receiver.c)
add_executable(neuropil_search_node examples/neuropil_search_node.c)
add_executable(neuropil_search_nlnet examples/neuropil_search_nlnet.c)
add_executable(neuropil_search_nlnet_2 examples/neuropil_search_nlnet_2.c)
target_link_libraries(neuropil sodium pthread m)
target_link_libraries(neuropil_node neuropil sodium ncurses)
target_link_libraries(neuropil_cloud neuropil sodium ncurses)
target_link_libraries(neuropil_hydra neuropil sodium ncurses)
target_link_libraries(neuropil_search_nlnet neuropil sodium ncurses)
target_link_libraries(neuropil_search_nlnet_2 neuropil sodium ncurses yajl)
target_link_libraries(neuropil_controller neuropil sodium)
target_link_libraries(neuropil_sender neuropil sodium)
target_link_libraries(neuropil_receiver neuropil sodium)
target_link_libraries(neuropil_identity neuropil sodium)
target_link_libraries(neuropil_search_node neuropil sodium)
target_link_libraries(neuropil_test neuropil criterion sodium)
target_include_directories(neuropil PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/include")
target_include_directories(neuropil PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/framework")
target_include_directories(neuropil PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/ext_tools")