blob: 747473b70ecee5ed3af35b35cf8e874e77d8327d (
plain)
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
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
|
# Copyright 2020-2021 The Mumble Developers. All rights reserved.
# Use of this source code is governed by a BSD-style license
# that can be found in the LICENSE file at the root of the
# Mumble source tree or at <https://www.mumble.info/LICENSE>.
set(PROTO_FILE "${CMAKE_CURRENT_SOURCE_DIR}/Mumble.proto")
option(client "Build the client (Mumble)" ON)
option(server "Build the server (Murmur)" ON)
option(qssldiffiehellmanparameters "Build support for custom Diffie-Hellman parameters." ON)
option(zeroconf "Build support for zeroconf (mDNS/DNS-SD)." ON)
option(dbus "Build support for DBus." ON)
find_pkg(Qt5
COMPONENTS
Core
Network
Xml
REQUIRED
)
find_pkg(OpenSSL
COMPONENTS
Crypto
SSL
REQUIRED
)
find_pkg(Protobuf REQUIRED)
add_library(shared STATIC)
protobuf_generate(LANGUAGE cpp TARGET shared PROTOS ${PROTO_FILE} OUT_VAR BUILT_PROTO_FILES)
# Disable warnings for the generated source files
foreach(CURRENT_FILE IN LISTS BUILT_PROTO_FILES)
set_source_files_properties("${CURRENT_FILE}" PROPERTIES COMPILE_FLAGS "-w")
endforeach()
set_target_properties(shared
PROPERTIES
AUTOMOC ON
# We explicitly tell CMake not to call any autogen tools (e.g. MOC) for the generated files.
# @ref https://cmake.org/cmake/help/latest/policy/CMP0071.html
SKIP_AUTOGEN ON
)
set(SHARED_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR})
set(SHARED_SOURCES
"Ban.cpp"
"EnvUtils.cpp"
"FFDHE.cpp"
"HostAddress.cpp"
"HTMLFilter.cpp"
"License.cpp"
"LogEmitter.cpp"
"OSInfo.cpp"
"PasswordGenerator.cpp"
"PlatformCheck.cpp"
"QtUtils.cpp"
"ProcessResolver.cpp"
"SelfSignedCertificate.cpp"
"ServerAddress.cpp"
"ServerResolver.cpp"
"ServerResolverRecord.cpp"
"SSL.cpp"
"SSLCipherInfo.cpp"
"SSLLocks.cpp"
"Timer.cpp"
"UnresolvedServerAddress.cpp"
"User.cpp"
"Version.cpp"
"crypto/CryptographicHash.cpp"
"crypto/CryptographicRandom.cpp"
"crypto/CryptStateOCB2.cpp"
"${3RDPARTY_DIR}/arc4random/arc4random_uniform.cpp"
)
set(SHARED_HEADERS
"Ban.h"
"ByteSwap.h"
"EnvUtils.h"
"FFDHE.h"
"FFDHETable.h"
"HostAddress.h"
"HTMLFilter.h"
"License.h"
"licenses.h"
"LogEmitter.h"
"Net.h"
"OSInfo.h"
"PasswordGenerator.h"
"PlatformCheck.h"
"ProcessResolver.h"
"SelfSignedCertificate.h"
"ServerAddress.h"
"ServerResolver.h"
"ServerResolverRecord.h"
"SSL.h"
"SSLCipherInfo.h"
"SSLCipherInfoTable.h"
"SSLLocks.h"
"Timer.h"
"UnresolvedServerAddress.h"
"User.h"
"Version.h"
"crypto/CryptographicHash.h"
"crypto/CryptographicRandom.h"
"crypto/CryptState.h"
"crypto/CryptStateOCB2.h"
"${3RDPARTY_DIR}/arc4random/arc4random_uniform.h"
)
target_sources(shared
PUBLIC
${SHARED_HEADERS}
PRIVATE
${SHARED_SOURCES}
)
target_compile_definitions(shared
PUBLIC
"MUMBLE_VERSION=${PROJECT_VERSION}"
# Only define this macro if RELEASE_ID is actually set
$<$<NOT:$<STREQUAL:"${RELEASE_ID}","">>:MUMBLE_RELEASE_ID=${RELEASE_ID}>
)
target_compile_definitions(shared
PRIVATE
"QT_RESTRICTED_CAST_FROM_ASCII"
)
target_include_directories(shared
PUBLIC
${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_CURRENT_BINARY_DIR}
PRIVATE
"${3RDPARTY_DIR}/arc4random"
)
target_link_libraries(shared
PUBLIC
protobuf::libprotobuf
OpenSSL::Crypto
OpenSSL::SSL
Qt5::Core
Qt5::Network
Qt5::Xml
)
if(WIN32)
target_link_libraries(shared PUBLIC qwave.lib)
elseif(APPLE)
find_library(LIB_CORESERVICES "CoreServices")
target_link_libraries(shared PUBLIC ${LIB_CORESERVICES})
endif()
if(qssldiffiehellmanparameters)
target_compile_definitions(shared PUBLIC "USE_QSSLDIFFIEHELLMANPARAMETERS")
endif()
if(client)
add_subdirectory(mumble)
if(UNIX AND NOT APPLE)
install(FILES "${CMAKE_SOURCE_DIR}/scripts/org.mumble_voip.mumble.appdata.xml" DESTINATION "share/metainfo")
install(FILES "${CMAKE_SOURCE_DIR}/scripts/org.mumble_voip.mumble.desktop" DESTINATION "share/applications")
install(FILES "${CMAKE_SOURCE_DIR}/icons/mumble.svg" DESTINATION "share/icons/hicolor/scalable/apps")
install(FILES "${CMAKE_SOURCE_DIR}/icons/mumble_256x256.png" DESTINATION "share/icons/hicolor/256x256/apps" RENAME "mumble.png")
endif()
endif()
if(server)
add_subdirectory(murmur)
endif()
if(tests)
add_subdirectory(tests)
endif()
|