]> git.proxmox.com Git - ceph.git/blob - ceph/src/civetweb/CMakeLists.txt
add subtree-ish sources for 12.0.3
[ceph.git] / ceph / src / civetweb / CMakeLists.txt
1 # Determines what CMake APIs we can rely on
2 cmake_minimum_required (VERSION 2.8.11)
3 if (${CMAKE_VERSION} VERSION_GREATER 3.2.2)
4 cmake_policy(VERSION 3.2.2)
5 endif()
6 if (${CMAKE_VERSION} VERSION_GREATER 3.1 OR
7 ${CMAKE_VERSION} VERSION_EQUAL 3.1)
8 cmake_policy(SET CMP0054 NEW)
9 endif()
10
11 # Do not allow in source builds
12 set(CMAKE_DISABLE_SOURCE_CHANGES ON)
13 set(CMAKE_DISABLE_IN_SOURCE_BUILD ON)
14
15 # Make sure we can import out CMake functions
16 list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
17
18 # Load in the needed CMake modules
19 include(CheckIncludeFiles)
20 include(CheckCCompilerFlag)
21 include(CheckCXXCompilerFlag)
22 include(AddCCompilerFlag)
23 include(AddCXXCompilerFlag)
24 include(DetermineTargetArchitecture)
25 include(CMakeDependentOption)
26
27 # Set up the project
28 project (civetweb)
29 set(CIVETWEB_VERSION "1.7.0" CACHE STRING "The version of the civetweb library")
30 string(REGEX MATCH "([0-9]+)\\.([0-9]+)\\.([0-9]+)" CIVETWEB_VERSION_MATCH "${CIVETWEB_VERSION}")
31 if ("${CIVETWEB_VERSION_MATCH}" STREQUAL "")
32 message(FATAL_ERROR "Must specify a semantic version: major.minor.patch")
33 endif()
34 set(CIVETWEB_VERSION_MAJOR "${CMAKE_MATCH_1}")
35 set(CIVETWEB_VERSION_MINOR "${CMAKE_MATCH_2}")
36 set(CIVETWEB_VERSION_PATCH "${CMAKE_MATCH_3}")
37 determine_target_architecture(CIVETWEB_ARCHITECTURE)
38
39 # Detect the platform reliably
40 if(NOT MACOSX AND ${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
41 SET(DARWIN YES)
42 elseif(NOT BSD AND ${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD")
43 SET(FREEBSD YES)
44 elseif(NOT LINUX AND ${CMAKE_SYSTEM_NAME} MATCHES "Linux")
45 SET(LINUX YES)
46 endif()
47
48 # C++ wrappers
49 option(CIVETWEB_ENABLE_THIRD_PARTY_OUTPUT "Shows the output of third party dependency processing" OFF)
50
51 # Max Request Size
52 set(CIVETWEB_MAX_REQUEST_SIZE 16384 CACHE STRING
53 "The largest amount of content bytes allowed in a request")
54 set_property(CACHE CIVETWEB_MAX_REQUEST_SIZE PROPERTY VALUE ${CIVETWEB_MAX_REQUEST_SIZE})
55 message(STATUS "Max Request Size - ${CIVETWEB_MAX_REQUEST_SIZE}")
56
57 # Thread Stack Size
58 set(CIVETWEB_THREAD_STACK_SIZE 102400 CACHE STRING
59 "The stack size in bytes for each thread created")
60 set_property(CACHE CIVETWEB_THREAD_STACK_SIZE PROPERTY VALUE ${CIVETWEB_THREAD_STACK_SIZE})
61 message(STATUS "Thread Stack Size - ${CIVETWEB_THREAD_STACK_SIZE}")
62
63 # Serve no files from the web server
64 option(CIVETWEB_SERVE_NO_FILES "Configures the server to serve no static files" OFF)
65 message(STATUS "Serve no static files - ${CIVETWEB_SERVE_NO_FILES}")
66
67 # Serve no files from the web server
68 option(CIVETWEB_DISABLE_CGI "Disables CGI, so theserver will not execute CGI scripts" OFF)
69 message(STATUS "Disable CGI support - ${CIVETWEB_DISABLE_CGI}")
70
71 # Disable caching
72 option(CIVETWEB_DISABLE_CACHING "Disables caching, so that no timegm is used." OFF)
73 message(STATUS "Disable caching support - ${CIVETWEB_DISABLE_CACHING}")
74
75 # C++ wrappers
76 option(CIVETWEB_ENABLE_CXX "Enables the C++ wrapper library" OFF)
77 message(STATUS "C++ wrappers - ${CIVETWEB_ENABLE_CXX}")
78
79 # IP Version 6
80 option(CIVETWEB_ENABLE_IPV6 "Enables the IP version 6 support" OFF)
81 message(STATUS "IP Version 6 - ${CIVETWEB_ENABLE_IPV6}")
82
83 # Websocket support
84 option(CIVETWEB_ENABLE_WEBSOCKETS "Enable websockets connections" OFF)
85 message(STATUS "Websockets support - ${CIVETWEB_ENABLE_WEBSOCKETS}")
86
87 # Memory debugging
88 option(CIVETWEB_ENABLE_MEMORY_DEBUGGING "Enable the memory debugging features" OFF)
89 message(STATUS "Memory Debugging - ${CIVETWEB_ENABLE_MEMORY_DEBUGGING}")
90
91 # LUA CGI support
92 option(CIVETWEB_ENABLE_LUA "Enable Lua CGIs" OFF)
93 message(STATUS "Lua CGI support - ${CIVETWEB_ENABLE_LUA}")
94
95 # Allow builds to complete with warnings (do not set -Werror)
96 if (LINUX)
97 # CivetWeb Linux support is stable: Builds must be free from warnings.
98 option(CIVETWEB_ALLOW_WARNINGS "Do not stop build if there are warnings" OFF)
99 else()
100 # CivetWeb Linux support for other systems is in a setup phase.
101 option(CIVETWEB_ALLOW_WARNINGS "Do not stop build if there are warnings" ON)
102 endif()
103 message(STATUS "Build if there are warnings - ${CIVETWEB_ALLOW_WARNINGS}")
104
105 # Link to the shared LUA library
106 cmake_dependent_option(
107 CIVETWEB_ENABLE_LUA_SHARED "Link to the shared LUA system library" OFF
108 CIVETWEB_ENABLE_LUA OFF)
109 if (CIVETWEB_ENABLE_LUA)
110 message(STATUS "Linking shared Lua library - ${CIVETWEB_ENABLE_LUA_SHARED}")
111 endif()
112
113 # Lua Third Party Settings
114 if (CIVETWEB_ENABLE_LUA)
115 if (NOT CIVETWEB_ENABLE_LUA_SHARED)
116 # Lua Version
117 set(CIVETWEB_LUA_VERSION 5.2.4 CACHE STRING
118 "The version of Lua to build and include statically")
119 set_property(CACHE CIVETWEB_LUA_VERSION PROPERTY VALUE ${CIVETWEB_LUA_VERSION})
120 message(STATUS "Lua Version - ${CIVETWEB_LUA_VERSION}")
121 mark_as_advanced(CIVETWEB_LUA_VERSION)
122
123 # Lua Verification Hash
124 set(CIVETWEB_LUA_MD5_HASH 913fdb32207046b273fdb17aad70be13 CACHE STRING
125 "The hash of Lua archive to be downloaded")
126 set_property(CACHE CIVETWEB_LUA_MD5_HASH PROPERTY VALUE ${CIVETWEB_LUA_MD5_HASH})
127 mark_as_advanced(CIVETWEB_LUA_MD5_HASH)
128 endif()
129
130 # Lua Filesystem Version
131 set(CIVETWEB_LUA_FILESYSTEM_VERSION 1.6.3 CACHE STRING
132 "The version of Lua Filesystem to build and include statically")
133 set_property(CACHE CIVETWEB_LUA_FILESYSTEM_VERSION PROPERTY VALUE ${CIVETWEB_LUA_FILESYSTEM_VERSION})
134 message(STATUS "Lua Filesystem Version - ${CIVETWEB_LUA_FILESYSTEM_VERSION}")
135 mark_as_advanced(CIVETWEB_LUA_FILESYSTEM_VERSION)
136
137 # Lua Filesystem Verification Hash
138 set(CIVETWEB_LUA_FILESYSTEM_MD5_HASH d0552c7e5a082f5bb2865af63fb9dc95 CACHE STRING
139 "The hash of Lua Filesystem archive to be downloaded")
140 set_property(CACHE CIVETWEB_LUA_FILESYSTEM_MD5_HASH PROPERTY VALUE ${CIVETWEB_LUA_FILESYSTEM_MD5_HASH})
141 mark_as_advanced(CIVETWEB_LUA_FILESYSTEM_MD5_HASH)
142
143 # Lua SQLite Version
144 set(CIVETWEB_LUA_SQLITE_VERSION 0.9.3 CACHE STRING
145 "The version of Lua SQLite to build and include statically")
146 set_property(CACHE CIVETWEB_LUA_SQLITE_VERSION PROPERTY VALUE ${CIVETWEB_LUA_SQLITE_VERSION})
147 message(STATUS "Lua SQLite Version - ${CIVETWEB_LUA_SQLITE_VERSION}")
148 mark_as_advanced(CIVETWEB_LUA_SQLITE_VERSION)
149
150 # Lua SQLite Verification Hash
151 set(CIVETWEB_LUA_SQLITE_MD5_HASH 43234ae08197dfce6da02482ed14ec92 CACHE STRING
152 "The hash of Lua SQLite archive to be downloaded")
153 set_property(CACHE CIVETWEB_LUA_SQLITE_MD5_HASH PROPERTY VALUE ${CIVETWEB_LUA_SQLITE_MD5_HASH})
154 mark_as_advanced(CIVETWEB_LUA_SQLITE_MD5_HASH)
155
156 # Lua XML Version
157 set(CIVETWEB_LUA_XML_VERSION 1.8.0 CACHE STRING
158 "The version of Lua XML to build and include statically")
159 set_property(CACHE CIVETWEB_LUA_XML_VERSION PROPERTY VALUE ${CIVETWEB_LUA_XML_VERSION})
160 message(STATUS "Lua XML Version - ${CIVETWEB_LUA_XML_VERSION}")
161 mark_as_advanced(CIVETWEB_LUA_XML_VERSION)
162
163 # Lua XML Verification Hash
164 set(CIVETWEB_LUA_XML_MD5_HASH 25e4c276c5d8716af1de0c7853aec2b4 CACHE STRING
165 "The hash of Lua XML archive to be downloaded")
166 set_property(CACHE CIVETWEB_LUA_XML_MD5_HASH PROPERTY VALUE ${CIVETWEB_LUA_XML_MD5_HASH})
167 mark_as_advanced(CIVETWEB_LUA_XML_MD5_HASH)
168
169 # SQLite Version
170 set(CIVETWEB_SQLITE_VERSION 3.8.9 CACHE STRING
171 "The version of SQLite to build and include statically")
172 set_property(CACHE CIVETWEB_SQLITE_VERSION PROPERTY VALUE ${CIVETWEB_SQLITE_VERSION})
173 message(STATUS "SQLite Version - ${CIVETWEB_SQLITE_VERSION}")
174 mark_as_advanced(CIVETWEB_SQLITE_VERSION)
175
176 # SQLite Verification Hash
177 set(CIVETWEB_SQLITE_MD5_HASH 02e9c3a6daa8b8587cf6bef828c2e33f CACHE STRING
178 "The hash of SQLite archive to be downloaded")
179 set_property(CACHE CIVETWEB_SQLITE_MD5_HASH PROPERTY VALUE ${CIVETWEB_SQLITE_MD5_HASH})
180 mark_as_advanced(CIVETWEB_SQLITE_MD5_HASH)
181 endif()
182
183 # Duktape CGI support
184 option(CIVETWEB_ENABLE_DUKTAPE "Enable Duktape CGIs" OFF)
185 message(STATUS "Duktape CGI support - ${CIVETWEB_ENABLE_DUKTAPE}")
186
187 # SSL support
188 option(CIVETWEB_ENABLE_SSL "Enables the secure socket layer" ON)
189 message(STATUS "SSL support - ${CIVETWEB_ENABLE_SSL}")
190
191 # Dynamically load or link the SSL libraries
192 cmake_dependent_option(
193 CIVETWEB_ENABLE_SSL_DYNAMIC_LOADING "Dynamically loads the SSL library rather than linking it" ON
194 CIVETWEB_ENABLE_SSL OFF)
195 if (CIVETWEB_ENABLE_SSL)
196 message(STATUS "Dynamically load SSL libraries - ${CIVETWEB_ENABLE_SSL_DYNAMIC_LOADING}")
197 endif()
198
199 # Third Party Download location
200 set(CIVETWEB_THIRD_PARTY_DIR "${CMAKE_BINARY_DIR}/third_party" CACHE STRING
201 "The location that third party code is downloaded, built and installed")
202 set_property(CACHE CIVETWEB_THIRD_PARTY_DIR PROPERTY VALUE ${CIVETWEB_THIRD_PARTY_DIR})
203
204 # Unix systems can define the dynamic library names to load
205 if (CIVETWEB_ENABLE_SSL_DYNAMIC_LOADING AND NOT DARWIN AND UNIX)
206 # SSL library name
207 set(CIVETWEB_SSL_SSL_LIB "libssl.so" CACHE STRING
208 "The name of the SSL library to load")
209 set_property(CACHE CIVETWEB_SSL_SSL_LIB PROPERTY VALUE ${CIVETWEB_SSL_SSL_LIB})
210 message(STATUS "SSL Library Name - ${CIVETWEB_SSL_SSL_LIB}")
211
212 # Crytography library name
213 set(CIVETWEB_SSL_CRYPTO_LIB "libcrypto.so" CACHE STRING
214 "The name of the SSL Cryptography library to load")
215 set_property(CACHE CIVETWEB_SSL_CRYPTO_LIB PROPERTY VALUE ${CIVETWEB_SSL_CRYPTO_LIB})
216 message(STATUS "SSL Cryptography Library Name - ${CIVETWEB_SSL_CRYPTO_LIB}")
217 endif()
218
219 # Allow warnings in 3rd party components
220 if (CIVETWEB_ENABLE_LUA OR CIVETWEB_ENABLE_DUKTAPE)
221 SET(CIVETWEB_ALLOW_WARNINGS YES)
222 endif()
223
224 # The C and C++ standards to use
225 set(CIVETWEB_C_STANDARD auto CACHE STRING
226 "The C standard to use; auto determines the latest supported by the compiler")
227 set_property(CACHE CIVETWEB_C_STANDARD PROPERTY STRINGS auto c11 c99 c89)
228 set(CIVETWEB_CXX_STANDARD auto CACHE STRING
229 "The C++ standard to use; auto determines the latest supported by the compiler")
230 set_property(CACHE CIVETWEB_CXX_STANDARD PROPERTY STRINGS auto c++14 c++11 c++98)
231
232 # Configure the linker
233 if ("${CMAKE_C_COMPILER_ID}" STREQUAL "GNU")
234 find_program(GCC_AR gcc-ar)
235 if (GCC_AR)
236 set(CMAKE_AR ${GCC_AR})
237 endif()
238 find_program(GCC_RANLIB gcc-ranlib)
239 if (GCC_RANLIB)
240 set(CMAKE_RANLIB ${GCC_RANLIB})
241 endif()
242 endif()
243
244 # Configure the C compiler
245 message(STATUS "Configuring C Compiler")
246 if ("${CIVETWEB_C_STANDARD}" STREQUAL "auto")
247 add_c_compiler_flag(-std=c11)
248 if (NOT HAVE_C_FLAG_STD_C11)
249 add_c_compiler_flag(-std=c99)
250 if (NOT HAVE_C_FLAG_STD_C99)
251 add_c_compiler_flag(-std=c89)
252 endif()
253 endif()
254 else()
255 add_c_compiler_flag(-std=${CIVETWEB_C_STANDARD})
256 endif()
257 add_c_compiler_flag(-Wall)
258 add_c_compiler_flag(-Wextra)
259 add_c_compiler_flag(-Wshadow)
260 add_c_compiler_flag(-Wsign-conversion)
261 add_c_compiler_flag(-Wmissing-prototypes)
262 add_c_compiler_flag(-Weverything)
263 add_c_compiler_flag(/W4)
264 add_c_compiler_flag(-Wno-padded)
265 add_c_compiler_flag(/Wd4820) # padding
266 add_c_compiler_flag(-Wno-unused-macros)
267 add_c_compiler_flag(-Wno-format-nonliteral)
268 if (MINGW)
269 add_c_compiler_flag(-Wno-format)
270 endif()
271 if (NOT CIVETWEB_ALLOW_WARNINGS)
272 add_c_compiler_flag(-Werror)
273 endif()
274 add_c_compiler_flag(/WX)
275 add_c_compiler_flag(-pedantic-errors)
276 add_c_compiler_flag(-fvisibility=hidden)
277 add_c_compiler_flag(-fstack-protector-strong RELEASE)
278 add_c_compiler_flag(-flto RELEASE)
279 add_c_compiler_flag(-fsanitize=undefined DEBUG)
280 add_c_compiler_flag(-fsanitize=address DEBUG)
281 if (HAVE_C_FLAG_FSANITIZE_ADDRESS)
282 add_c_compiler_flag(-static-asan DEBUG)
283 endif()
284 add_c_compiler_flag(-fstack-protector-all DEBUG)
285 if (MINGW)
286 add_c_compiler_flag(-mwindows)
287 endif()
288
289 # Coverage build type
290 set(CMAKE_C_FLAGS_COVERAGE "${CMAKE_C_FLAGS_DEBUG}" CACHE STRING
291 "Flags used by the C compiler during coverage builds."
292 FORCE)
293 set(CMAKE_EXE_LINKER_FLAGS_COVERAGE
294 "${CMAKE_EXE_LINKER_FLAGS_DEBUG}" CACHE STRING
295 "Flags used for linking binaries during coverage builds."
296 FORCE)
297 set(CMAKE_SHARED_LINKER_FLAGS_COVERAGE
298 "${CMAKE_SHARED_LINKER_FLAGS_DEBUG}" CACHE STRING
299 "Flags used by the shared libraries linker during coverage builds."
300 FORCE)
301 mark_as_advanced(
302 CMAKE_CXX_FLAGS_COVERAGE
303 CMAKE_C_FLAGS_COVERAGE
304 CMAKE_EXE_LINKER_FLAGS_COVERAGE
305 CMAKE_SHARED_LINKER_FLAGS_COVERAGE)
306 set(CMAKE_BUILD_TYPE "${CMAKE_BUILD_TYPE}" CACHE STRING
307 "Choose the type of build, options are: None Debug Release RelWithDebInfo MinSizeRel Coverage."
308 FORCE)
309 add_c_compiler_flag(--coverage COVERAGE)
310
311 # Configure the C++ compiler
312 if (CIVETWEB_ENABLE_CXX)
313 message(STATUS "Configuring C++ Compiler")
314 if ("${CIVETWEB_CXX_STANDARD}" STREQUAL "auto")
315 add_cxx_compiler_flag(-std=c++14)
316 if (NOT HAVE_CXX_FLAG_STD_CXX14)
317 add_cxx_compiler_flag(-std=c++11)
318 if (NOT HAVE_CXX_FLAG_STD_CXX11)
319 add_cxx_compiler_flag(-std=c++98)
320 endif()
321 endif()
322 else()
323 add_cxx_compiler_flag(-std=${CIVETWEB_CXX_STANDARD})
324 endif()
325 add_cxx_compiler_flag(-Wall)
326 add_cxx_compiler_flag(-Wextra)
327 add_cxx_compiler_flag(-Wshadow)
328 add_cxx_compiler_flag(-Wmissing-prototypes)
329 add_cxx_compiler_flag(-Weverything)
330 add_cxx_compiler_flag(/W4)
331 add_cxx_compiler_flag(-Wno-padded)
332 add_cxx_compiler_flag(/Wd4820) # padding
333 add_cxx_compiler_flag(-Wno-unused-macros)
334 add_cxx_compiler_flag(-Wno-format-nonliteral)
335 if (MINGW)
336 add_cxx_compiler_flag(-Wno-format)
337 endif()
338 if (NOT CIVETWEB_ALLOW_WARNINGS)
339 add_cxx_compiler_flag(-Werror)
340 endif()
341 add_cxx_compiler_flag(/WX)
342 add_cxx_compiler_flag(-pedantic-errors)
343 add_cxx_compiler_flag(-fvisibility=hidden)
344 add_cxx_compiler_flag(-fstack-protector-strong RELEASE)
345 add_cxx_compiler_flag(-flto RELEASE)
346 add_cxx_compiler_flag(-fsanitize=undefined DEBUG)
347 add_cxx_compiler_flag(-fsanitize=address DEBUG)
348 if (HAVE_CXX_FLAG_FSANITIZE_ADDRESS)
349 add_cxx_compiler_flag(-static-asan DEBUG)
350 endif()
351 add_cxx_compiler_flag(-fstack-protector-all DEBUG)
352 if (MINGW)
353 add_cxx_compiler_flag(-mwindows)
354 endif()
355 set(CMAKE_CXX_FLAGS_COVERAGE "${CMAKE_CXX_FLAGS_DEBUG}" CACHE STRING
356 "Flags used by the C++ compiler during coverage builds."
357 FORCE)
358 add_cxx_compiler_flag(--coverage COVERAGE)
359 endif()
360
361 # Check the headers we need
362 check_include_files(stdint.h HAVE_STDINT)
363
364 # Set up the definitions
365 if (${CMAKE_BUILD_TYPE} MATCHES "[Dd]ebug")
366 add_definitions(-DDEBUG)
367 endif()
368 if (HAVE_STDINT)
369 add_definitions(-DHAVE_STDINT)
370 endif()
371 if (CIVETWEB_ENABLE_IPV6)
372 add_definitions(-DUSE_IPV6)
373 endif()
374 if (CIVETWEB_ENABLE_WEBSOCKETS)
375 add_definitions(-DUSE_WEBSOCKET)
376 endif()
377 if (CIVETWEB_SERVE_NO_FILES)
378 add_definitions(-DNO_FILES)
379 endif()
380 if (CIVETWEB_DISABLE_CGI)
381 add_definitions(-DNO_CGI)
382 endif()
383 if (CIVETWEB_DISABLE_CACHING)
384 add_definitions(-DNO_CACHING)
385 endif()
386 if (CIVETWEB_ENABLE_LUA)
387 add_definitions(-DUSE_LUA)
388 endif()
389 if (CIVETWEB_ENABLE_DUKTAPE)
390 add_definitions(-DUSE_DUKTAPE)
391 endif()
392 if (CIVETWEB_ENABLE_MEMORY_DEBUGGING)
393 add_definitions(-DMEMORY_DEBUGGING)
394 endif()
395 if (NOT CIVETWEB_ENABLE_SSL)
396 add_definitions(-DNO_SSL)
397 elseif (NOT CIVETWEB_ENABLE_SSL_DYNAMIC_LOADING)
398 add_definitions(-DNO_SSL_DL)
399 else()
400 if(CIVETWEB_SSL_SSL_LIB)
401 add_definitions(-DSSL_LIB="${CIVETWEB_SSL_SSL_LIB}")
402 endif()
403 if(CIVETWEB_SSL_CRYPTO_LIB)
404 add_definitions(-DCRYPTO_LIB="${CIVETWEB_SSL_CRYPTO_LIB}")
405 endif()
406 endif()
407 add_definitions(-DUSE_STACK_SIZE=${CIVETWEB_THREAD_STACK_SIZE})
408 add_definitions(-DMAX_REQUEST_SIZE=${CIVETWEB_MAX_REQUEST_SIZE})
409
410 # Build the targets
411 add_subdirectory(src)
412
413 # Enable the testing of the library/executable
414 include(CTest)
415 if (BUILD_TESTING)
416 # Check unit testing framework Version
417 set(CIVETWEB_CHECK_VERSION 0.10.0 CACHE STRING
418 "The version of Check unit testing framework to build and include statically")
419 set_property(CACHE CIVETWEB_CHECK_VERSION PROPERTY VALUE ${CIVETWEB_CHECK_VERSION})
420 message(STATUS "Check Unit Testing Framework Version - ${CIVETWEB_CHECK_VERSION}")
421 mark_as_advanced(CIVETWEB_CHECK_VERSION)
422
423 # Check unit testing framework Verification Hash
424 set(CIVETWEB_CHECK_MD5_HASH 67a34c40b5bc888737f4e5ae82e9939f CACHE STRING
425 "The hash of Check unit testing framework archive to be downloaded")
426 set_property(CACHE CIVETWEB_CHECK_MD5_HASH PROPERTY VALUE ${CIVETWEB_CHECK_MD5_HASH})
427 mark_as_advanced(CIVETWEB_CHECK_MD5_HASH)
428
429 # Build the testing
430 add_subdirectory(test)
431 endif()
432
433 # Set up CPack
434 include(InstallRequiredSystemLibraries)
435 set(CPACK_PACKAGE_VENDOR "civetweb Contributors")
436 set(CPACK_PACKAGE_CONTACT "civetweb@github.com")
437 set(CPACK_PACKAGE_VERSION_MAJOR "${CIVETWEB_VERSION_MAJOR}")
438 set(CPACK_PACKAGE_VERSION_MINOR "${CIVETWEB_VERSION_MINOR}")
439 set(CPACK_PACKAGE_VERSION_PATCH "${CIVETWEB_VERSION_PATCH}")
440 set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "A HTTP library and server")
441 set(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/README.md")
442 set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/LICENSE.md")
443 set(CPACK_STRIP_FILES TRUE)
444 set(CPACK_PACKAGE_DEPENDS "openssl")
445 if (CIVETWEB_ENABLE_LUA_SHARED)
446 set(CPACK_PACKAGE_DEPENDS "lua, ${CPACK_PACKAGE_DEPENDS}")
447 endif()
448
449 # RPM Packaging
450 set(CPACK_RPM_PACKAGE_GROUP "Development/Libraries")
451 set(CPACK_RPM_PACKAGE_LICENSE "MIT")
452 set(CPACK_RPM_PACKAGE_ARCHITECTURE "${CIVETWEB_ARCHITECTURE}")
453 set(CPACK_RPM_PACKAGE_REQUIRES "${CPACK_PACKAGE_DEPENDS}")
454
455 # Debian Packaging
456 set(CPACK_DEBIAN_PACKAGE_ARCHITECTURE "${CIVETWEB_ARCHITECTURE}")
457 set(CPACK_DEBIAN_PACKAGE_HOMEPAGE "https://github.com/civetweb/civetweb")
458 set(CPACK_DEBIAN_PACKAGE_DEPENDS "${CPACK_PACKAGE_DEPENDS}")
459
460 # WiX Packaging
461 # TODO: www.cmake.org/cmake/help/v3.0/module/CPackWIX.html
462
463 # Finalize CPack settings
464 include(CPack)