forked from flomesh-io/pipy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
127 lines (112 loc) · 2.98 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
cmake_minimum_required (VERSION 2.8)
project(pipy)
option(PIPY_GUI "include builtin GUI" OFF)
add_subdirectory(deps/yajl-2.1.0)
option(BUILD_shared "build a shared expat library" OFF)
add_subdirectory(deps/libexpat-R_2_2_6/expat)
add_subdirectory(deps/openssl-1.1.1g)
set(EXECUTABLE_OUTPUT_PATH ${CMAKE_SOURCE_DIR}/bin)
set(CMAKE_CXX_FLAGS -std=c++11)
add_definitions(
-D_GNU_SOURCE
-DPIPY_HOST="${CMAKE_HOST_SYSTEM} ${CMAKE_HOST_SYSTEM_PROCESSOR}"
)
include_directories(
"${CMAKE_SOURCE_DIR}/src"
"${CMAKE_SOURCE_DIR}/deps/asio-1.12.2/include"
"${CMAKE_BINARY_DIR}/deps"
"${CMAKE_BINARY_DIR}/deps/yajl-2.1.0/yajl-2.1.0/include"
"${CMAKE_BINARY_DIR}/deps/libexpat-R_2_2_6/expat/lib"
"${CMAKE_SOURCE_DIR}/deps/libexpat-R_2_2_6/expat/lib"
)
add_executable(pipy
src/api/algo.cpp
src/api/configuration.cpp
src/api/console.cpp
src/api/crypto.cpp
src/api/hessian.cpp
src/api/http.cpp
src/api/json.cpp
src/api/netmask.cpp
src/api/os.cpp
src/api/pipy.cpp
src/api/url.cpp
src/api/xml.cpp
src/codebase.cpp
src/compress.cpp
src/context.cpp
src/data.cpp
src/event.cpp
src/fetch.cpp
src/filter.cpp
src/filters/connect.cpp
src/filters/decompress-message.cpp
src/filters/demux.cpp
src/filters/dubbo.cpp
src/filters/dummy.cpp
src/filters/dump.cpp
src/filters/exec.cpp
src/filters/fork.cpp
src/filters/http.cpp
src/filters/link.cpp
src/filters/merge.cpp
src/filters/mux.cpp
src/filters/on-body.cpp
src/filters/on-event.cpp
src/filters/on-message.cpp
src/filters/on-start.cpp
src/filters/pack.cpp
src/filters/print.cpp
src/filters/replace-body.cpp
src/filters/replace-event.cpp
src/filters/replace-message.cpp
src/filters/replace-start.cpp
src/filters/socks.cpp
src/filters/socks4.cpp
src/filters/tap.cpp
src/filters/tls.cpp
src/filters/use.cpp
src/filters/wait.cpp
src/fstream.cpp
src/graph.cpp
src/gui.cpp
src/inbound.cpp
src/listener.cpp
src/logging.cpp
src/main.cpp
src/message.cpp
src/module.cpp
src/net.cpp
src/options.cpp
src/outbound.cpp
src/pipeline.cpp
src/pjs/builtin.cpp
src/pjs/expr.cpp
src/pjs/parser.cpp
src/pjs/types.cpp
src/session.cpp
src/tar.cpp
src/task.cpp
src/utils.cpp
src/worker.cpp
)
add_custom_command(
OUTPUT ${CMAKE_BINARY_DIR}/deps/version.h
COMMAND ${CMAKE_SOURCE_DIR}/generate_version_h.sh
ARGS ${CMAKE_BINARY_DIR}/deps/version.h
WORKING_DIRECTORY ${CMAKE_BINARY_DIR})
add_custom_target(GenVer DEPENDS ${CMAKE_BINARY_DIR}/deps/version.h)
add_dependencies(pipy yajl_s expat crypto ssl GenVer)
if(PIPY_GUI)
add_definitions(-DPIPY_USE_GUI)
add_custom_command(
OUTPUT ${CMAKE_BINARY_DIR}/deps/gui.tar.h
COMMAND node
ARGS pack.js ${CMAKE_BINARY_DIR}/deps/gui.tar.h
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/gui
DEPENDS gui/pack.js ${CMAKE_SOURCE_DIR}/gui/public/index.html
)
add_custom_target(GenGui DEPENDS ${CMAKE_BINARY_DIR}/deps/gui.tar.h)
add_dependencies(pipy GenGui)
endif()
target_link_libraries(pipy z yajl_s expat crypto ssl -pthread)