This repository has been archived by the owner on Jun 30, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
CMakeLists.txt
163 lines (148 loc) · 5.66 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
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
# CMake file for NuriaNetwork
# Source: https://github.com/NuriaProject/Network
cmake_minimum_required(VERSION 2.8.8)
# Base configuration
PROJECT(NuriaNetwork)
cmake_policy(SET CMP0020 NEW)
# Enable moc
SET(CMAKE_AUTOMOC ON)
SET(CMAKE_INCLUDE_CURRENT_DIR ON)
# Dependencies
FIND_PACKAGE(Qt5Core REQUIRED)
FIND_PACKAGE(Qt5Network REQUIRED)
if (NOT TARGET NuriaCore)
FIND_PACKAGE(NuriaCore REQUIRED)
endif()
#
SET(NuriaNetwork_SRC
src/httpclient.cpp
src/nuria/httpclient.hpp
src/httpmultipartreader.cpp
src/nuria/httpmultipartreader.hpp
src/httpurlencodedreader.cpp
src/nuria/httpurlencodedreader.hpp
src/httpnode.cpp
src/nuria/httpnode.hpp
src/httpparser.cpp
src/nuria/httpparser.hpp
src/httppostbodyreader.cpp
src/nuria/httppostbodyreader.hpp
src/httpfilter.cpp
src/nuria/httpfilter.hpp
src/httpserver.cpp
src/nuria/httpserver.hpp
src/abstracttransport.cpp
src/nuria/abstracttransport.hpp
src/httptransport.cpp
src/nuria/httptransport.hpp
src/httpwriter.cpp
src/nuria/httpwriter.hpp
src/nuria/network_global.hpp
src/restfulhttpnode.cpp
src/nuria/restfulhttpnode.hpp
src/rewritehttpnode.cpp
src/nuria/rewritehttpnode.hpp
src/httpbackend.cpp
src/nuria/httpbackend.hpp
src/sslserver.cpp
src/nuria/sslserver.hpp
src/fastcgibackend.cpp
src/nuria/fastcgibackend.hpp
src/websocket.cpp
src/nuria/websocket.hpp
src/private/httptcptransport.cpp
src/private/httptcptransport.hpp
src/private/httpprivate.hpp
src/private/transportprivate.hpp
src/private/standardfilters.cpp
src/private/standardfilters.hpp
src/private/httpthread.cpp
src/private/httpthread.hpp
src/private/tcpserver.cpp
src/private/tcpserver.hpp
src/private/httptcpbackend.cpp
src/private/httptcpbackend.hpp
src/private/fastcgireader.cpp
src/private/fastcgireader.hpp
src/private/fastcgiwriter.cpp
src/private/fastcgiwriter.hpp
src/private/fastcgistructures.hpp
src/private/fastcgithreadobject.cpp
src/private/fastcgithreadobject.hpp
src/private/fastcgitransport.cpp
src/private/fastcgitransport.hpp
src/private/fastcgiwriter.cpp
src/private/fastcgiwriter.hpp
src/private/localserver.cpp
src/private/localserver.hpp
src/private/websocketstructures.hpp
src/private/websocketreader.cpp
src/private/websocketreader.hpp
src/private/websocketwriter.cpp
src/private/websocketwriter.hpp
src/private/jsonrpcutil.cpp
src/private/jsonrpcutil.hpp
src/private/crc32.h
src/private/adler32.h
)
# Create build target
ADD_LIBRARY(NuriaNetwork SHARED ${NuriaNetwork_SRC})
target_link_libraries(NuriaNetwork NuriaCore)
QT5_USE_MODULES(NuriaNetwork Core Network)
#
set_target_properties(
NuriaNetwork PROPERTIES
VERSION ${NURIA_VERSION}
SOVERSION ${NURIA_SOVERSION}
)
# Add public include directories to target
target_include_directories(NuriaNetwork PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/src>
$<INSTALL_INTERFACE:include>
)
# Install target
INSTALL(TARGETS NuriaNetwork EXPORT NuriaNetworkConfig
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib
RUNTIME DESTINATION bin
)
INSTALL(DIRECTORY src/nuria/ DESTINATION include/nuria
FILES_MATCHING PATTERN "*.hpp"
PATTERN "private" EXCLUDE
)
INSTALL(EXPORT NuriaNetworkConfig DESTINATION lib/cmake/NuriaNetwork)
export(TARGETS NuriaNetwork FILE "${NURIA_CMAKE_PREFIX}/NuriaNetworkConfig.cmake")
# Add Tests
enable_testing()
add_unittest(NAME tst_httpclient QT Network NURIA NuriaNetwork
SOURCES httpmemorytransport.cpp httpmemorytransport.hpp)
add_unittest(NAME tst_httpmultipartreader QT Network NURIA NuriaNetwork)
add_unittest(NAME tst_httpurlencodedreader QT Network NURIA NuriaNetwork)
add_unittest(NAME tst_httpparser QT Network NURIA NuriaNetwork)
add_unittest(NAME tst_httpwriter QT Network NURIA NuriaNetwork)
add_unittest(NAME tst_abstracttransport QT Network NURIA NuriaNetwork)
add_unittest(NAME tst_restfulhttpnode QT Network NURIA NuriaNetwork
SOURCES httpmemorytransport.cpp httpmemorytransport.hpp testnode.hpp)
add_unittest(NAME tst_rewritehttpnode QT Network NURIA NuriaNetwork
SOURCES httpmemorytransport.cpp httpmemorytransport.hpp)
if(NOT WIN32)
add_unittest(NAME tst_fastcgireader QT Network NURIA NuriaNetwork)
add_unittest(NAME tst_fastcgiwriter QT Network NURIA NuriaNetwork)
add_unittest(NAME tst_httptcptransport QT Network NURIA NuriaNetwork)
add_unittest(NAME tst_websocketreader QT Network NURIA NuriaNetwork)
add_unittest(NAME tst_websocketwriter QT Network NURIA NuriaNetwork)
add_unittest(NAME tst_websocket QT Network NURIA NuriaNetwork
SOURCES httpmemorytransport.cpp httpmemorytransport.hpp)
add_unittest(NAME tst_jsonrpcutil QT Network NURIA NuriaNetwork)
else()
add_unittest(NAME tst_fastcgireader QT Network DEFINES NuriaNetwork_EXPORTS EMBED_TARGETS NuriaNetwork)
add_unittest(NAME tst_fastcgiwriter QT Network DEFINES NuriaNetwork_EXPORTS EMBED_TARGETS NuriaNetwork)
add_unittest(NAME tst_httptcptransport QT Network DEFINES NuriaNetwork_EXPORTS EMBED_TARGETS NuriaNetwork)
add_unittest(NAME tst_websocketreader QT Network DEFINES NuriaNetwork_EXPORTS EMBED_TARGETS NuriaNetwork)
add_unittest(NAME tst_websocketwriter QT Network DEFINES NuriaNetwork_EXPORTS EMBED_TARGETS NuriaNetwork)
add_unittest(NAME tst_websocket QT Network DEFINES NuriaNetwork_EXPORTS EMBED_TARGETS NuriaNetwork
SOURCES httpmemorytransport.cpp httpmemorytransport.hpp)
add_unittest(NAME tst_jsonrpcutil QT Network DEFINES NuriaNetwork_EXPORTS EMBED_TARGETS NuriaNetwork)
endif()
# Autobahn Testsuite server tool
add_subdirectory(tests/autobahn)