-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathCMakeLists.txt
76 lines (63 loc) · 1.94 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
cmake_minimum_required(VERSION 2.6)
project(kayos)
#set(CMAKE_C_FLAGS_COMMON "-std=gnu99 -Wall -Wextra")
set(CMAKE_C_FLAGS_COMMON "-std=gnu11 -Wall -Wextra")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${CMAKE_C_FLAGS_COMMON}")
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} ${CMAKE_C_FLAGS_COMMON} -DKAYOS_DEBUG")
set(kayos_VERSION_MAJOR 0)
set(kayos_VERSION_MINOR 1)
include_directories(BEFORE ${PROJECT_SOURCE_DIR}/src)
include_directories(BEFORE ${PROJECT_SOURCE_DIR}/include)
include_directories(BEFORE ${PROJECT_SOURCE_DIR}/deps/forestdb/include/libforestdb)
include_directories(BEFORE ${PROJECT_SOURCE_DIR}/deps/http-parser)
include_directories(${CMAKE_CURRENT_BINARY_DIR}/deps/jansson/include)
include_directories(
deps/jansson/include
deps/forestdb/include/libforestdb
deps/http-parser
)
find_package(PythonLibs)
#message("CMAKE_INCLUDE_PATH: ${CMAKE_INCLUDE_PATH}")
add_subdirectory(deps/forestdb)
find_path(FORESTDB_INCLUDES
NAMES forestdb.h
PATHS ${PROJECT_SOURCE_DIR}/deps/forestdb/include/libforestdb/forestdb.h)
add_subdirectory(deps/jansson)
find_path(JANSSON_INCLUDES
NAMES jansson.h
PATHS ${PROJECT_SOURCE_DIR}/deps/jansson/src/jansson.h)
find_path(HTTP-PARSER-INCLUDES
NAMES http_parser.h
PATHS ${PROJECT_SOURCE_DIR}/deps/http-parser)
set(common_files
src/both.c
src/buffer.c
src/errors.c
src/hexdump.c
src/json_utils.c
src/paths.c
src/io.c
deps/http-parser/http_parser.c
deps/http-parser/http_parser.h
)
add_executable(kayos-producer
${common_files}
src/kayos_producer_main.c
src/producer.c
src/producer_http.c
src/producer_json.c
)
target_link_libraries(kayos-producer forestdb jansson)
add_executable(kayos-consumer
${common_files}
src/kayos_consumer_main.c
src/consumer.c
src/consumer_http.c
src/consumer_json.c
)
target_link_libraries(kayos-consumer forestdb jansson)
add_executable(kayos-server
${common_files}
src/kayos_server_main.c
)
target_link_libraries(kayos-server forestdb jansson)