Mercurial > hg > orthanc
annotate Resources/CMake/CivetwebConfiguration.cmake @ 3568:589238dcd782
DYNAMIC_MINGW_STDLIB
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Tue, 12 Nov 2019 18:28:23 +0100 |
parents | 6d558598d713 |
children | 9c091747483a |
rev | line source |
---|---|
2377
32bea64e070b
Experimental support of actively maintained Civetweb to replace Mongoose 3.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1 if (STATIC_BUILD OR NOT USE_SYSTEM_CIVETWEB) |
3068
ad37c21ec4db
fix compatibility with civetweb 1.11
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2450
diff
changeset
|
2 set(CIVETWEB_SOURCES_DIR ${CMAKE_BINARY_DIR}/civetweb-1.11) |
3133
0c2a8d5e0097
moving third-party dependencies to another server
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3128
diff
changeset
|
3 set(CIVETWEB_URL "http://orthanc.osimis.io/ThirdPartyDownloads/civetweb-1.11.tar.gz") |
3068
ad37c21ec4db
fix compatibility with civetweb 1.11
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2450
diff
changeset
|
4 set(CIVETWEB_MD5 "b6d2175650a27924bccb747cbe084cd4") |
2377
32bea64e070b
Experimental support of actively maintained Civetweb to replace Mongoose 3.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5 |
3128
972cc98959a3
fix build of civetweb for Visual Studio 2008 and LSB
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3068
diff
changeset
|
6 if (IS_DIRECTORY "${CIVETWEB_SOURCES_DIR}") |
972cc98959a3
fix build of civetweb for Visual Studio 2008 and LSB
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3068
diff
changeset
|
7 set(FirstRun OFF) |
972cc98959a3
fix build of civetweb for Visual Studio 2008 and LSB
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3068
diff
changeset
|
8 else() |
972cc98959a3
fix build of civetweb for Visual Studio 2008 and LSB
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3068
diff
changeset
|
9 set(FirstRun ON) |
972cc98959a3
fix build of civetweb for Visual Studio 2008 and LSB
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3068
diff
changeset
|
10 endif() |
972cc98959a3
fix build of civetweb for Visual Studio 2008 and LSB
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3068
diff
changeset
|
11 |
2377
32bea64e070b
Experimental support of actively maintained Civetweb to replace Mongoose 3.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
12 DownloadPackage(${CIVETWEB_MD5} ${CIVETWEB_URL} "${CIVETWEB_SOURCES_DIR}") |
32bea64e070b
Experimental support of actively maintained Civetweb to replace Mongoose 3.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
13 |
3128
972cc98959a3
fix build of civetweb for Visual Studio 2008 and LSB
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3068
diff
changeset
|
14 execute_process( |
972cc98959a3
fix build of civetweb for Visual Studio 2008 and LSB
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3068
diff
changeset
|
15 COMMAND ${PATCH_EXECUTABLE} -p0 -N -i |
972cc98959a3
fix build of civetweb for Visual Studio 2008 and LSB
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3068
diff
changeset
|
16 ${ORTHANC_ROOT}/Resources/Patches/civetweb-1.11.patch |
972cc98959a3
fix build of civetweb for Visual Studio 2008 and LSB
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3068
diff
changeset
|
17 WORKING_DIRECTORY ${CMAKE_BINARY_DIR} |
972cc98959a3
fix build of civetweb for Visual Studio 2008 and LSB
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3068
diff
changeset
|
18 RESULT_VARIABLE Failure |
972cc98959a3
fix build of civetweb for Visual Studio 2008 and LSB
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3068
diff
changeset
|
19 ) |
972cc98959a3
fix build of civetweb for Visual Studio 2008 and LSB
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3068
diff
changeset
|
20 |
972cc98959a3
fix build of civetweb for Visual Studio 2008 and LSB
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3068
diff
changeset
|
21 if (FirstRun AND Failure) |
972cc98959a3
fix build of civetweb for Visual Studio 2008 and LSB
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3068
diff
changeset
|
22 message(FATAL_ERROR "Error while patching a file") |
972cc98959a3
fix build of civetweb for Visual Studio 2008 and LSB
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3068
diff
changeset
|
23 endif() |
972cc98959a3
fix build of civetweb for Visual Studio 2008 and LSB
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3068
diff
changeset
|
24 |
2377
32bea64e070b
Experimental support of actively maintained Civetweb to replace Mongoose 3.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
25 include_directories( |
2378 | 26 ${CIVETWEB_SOURCES_DIR}/include |
2377
32bea64e070b
Experimental support of actively maintained Civetweb to replace Mongoose 3.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
27 ) |
32bea64e070b
Experimental support of actively maintained Civetweb to replace Mongoose 3.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
28 |
32bea64e070b
Experimental support of actively maintained Civetweb to replace Mongoose 3.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
29 set(CIVETWEB_SOURCES |
32bea64e070b
Experimental support of actively maintained Civetweb to replace Mongoose 3.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
30 ${CIVETWEB_SOURCES_DIR}/src/civetweb.c |
32bea64e070b
Experimental support of actively maintained Civetweb to replace Mongoose 3.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
31 ) |
32bea64e070b
Experimental support of actively maintained Civetweb to replace Mongoose 3.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
32 |
32bea64e070b
Experimental support of actively maintained Civetweb to replace Mongoose 3.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
33 if (ENABLE_SSL) |
32bea64e070b
Experimental support of actively maintained Civetweb to replace Mongoose 3.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
34 add_definitions( |
32bea64e070b
Experimental support of actively maintained Civetweb to replace Mongoose 3.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
35 -DNO_SSL_DL=1 |
32bea64e070b
Experimental support of actively maintained Civetweb to replace Mongoose 3.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
36 ) |
32bea64e070b
Experimental support of actively maintained Civetweb to replace Mongoose 3.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
37 if (${CMAKE_SYSTEM_NAME} STREQUAL "Linux" OR |
32bea64e070b
Experimental support of actively maintained Civetweb to replace Mongoose 3.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
38 ${CMAKE_SYSTEM_NAME} STREQUAL "kFreeBSD") |
32bea64e070b
Experimental support of actively maintained Civetweb to replace Mongoose 3.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
39 link_libraries(dl) |
32bea64e070b
Experimental support of actively maintained Civetweb to replace Mongoose 3.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
40 endif() |
32bea64e070b
Experimental support of actively maintained Civetweb to replace Mongoose 3.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
41 |
32bea64e070b
Experimental support of actively maintained Civetweb to replace Mongoose 3.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
42 else() |
32bea64e070b
Experimental support of actively maintained Civetweb to replace Mongoose 3.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
43 add_definitions( |
32bea64e070b
Experimental support of actively maintained Civetweb to replace Mongoose 3.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
44 -DNO_SSL=1 # Remove SSL support from civetweb |
32bea64e070b
Experimental support of actively maintained Civetweb to replace Mongoose 3.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
45 ) |
32bea64e070b
Experimental support of actively maintained Civetweb to replace Mongoose 3.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
46 endif() |
32bea64e070b
Experimental support of actively maintained Civetweb to replace Mongoose 3.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
47 |
32bea64e070b
Experimental support of actively maintained Civetweb to replace Mongoose 3.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
48 source_group(ThirdParty\\Civetweb REGULAR_EXPRESSION ${CIVETWEB_SOURCES_DIR}/.*) |
32bea64e070b
Experimental support of actively maintained Civetweb to replace Mongoose 3.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
49 |
3178
6d558598d713
Fix build with unpatched versions of Civetweb (missing "mg_disable_keep_alive()")
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3133
diff
changeset
|
50 add_definitions( |
6d558598d713
Fix build with unpatched versions of Civetweb (missing "mg_disable_keep_alive()")
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3133
diff
changeset
|
51 -DCIVETWEB_HAS_DISABLE_KEEP_ALIVE=1 |
6d558598d713
Fix build with unpatched versions of Civetweb (missing "mg_disable_keep_alive()")
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3133
diff
changeset
|
52 ) |
6d558598d713
Fix build with unpatched versions of Civetweb (missing "mg_disable_keep_alive()")
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3133
diff
changeset
|
53 |
2377
32bea64e070b
Experimental support of actively maintained Civetweb to replace Mongoose 3.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
54 else() |
32bea64e070b
Experimental support of actively maintained Civetweb to replace Mongoose 3.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
55 CHECK_INCLUDE_FILE_CXX(civetweb.h HAVE_CIVETWEB_H) |
32bea64e070b
Experimental support of actively maintained Civetweb to replace Mongoose 3.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
56 if (NOT HAVE_CIVETWEB_H) |
32bea64e070b
Experimental support of actively maintained Civetweb to replace Mongoose 3.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
57 message(FATAL_ERROR "Please install the libcivetweb-devel package") |
32bea64e070b
Experimental support of actively maintained Civetweb to replace Mongoose 3.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
58 endif() |
32bea64e070b
Experimental support of actively maintained Civetweb to replace Mongoose 3.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
59 |
32bea64e070b
Experimental support of actively maintained Civetweb to replace Mongoose 3.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
60 cmake_reset_check_state() |
32bea64e070b
Experimental support of actively maintained Civetweb to replace Mongoose 3.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
61 set(CMAKE_REQUIRED_LIBRARIES dl pthread) |
32bea64e070b
Experimental support of actively maintained Civetweb to replace Mongoose 3.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
62 CHECK_LIBRARY_EXISTS(civetweb mg_start "" HAVE_CIVETWEB_LIB) |
32bea64e070b
Experimental support of actively maintained Civetweb to replace Mongoose 3.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
63 if (NOT HAVE_CIVETWEB_LIB) |
32bea64e070b
Experimental support of actively maintained Civetweb to replace Mongoose 3.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
64 message(FATAL_ERROR "Please install the libcivetweb-devel package") |
32bea64e070b
Experimental support of actively maintained Civetweb to replace Mongoose 3.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
65 endif() |
32bea64e070b
Experimental support of actively maintained Civetweb to replace Mongoose 3.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
66 |
32bea64e070b
Experimental support of actively maintained Civetweb to replace Mongoose 3.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
67 link_libraries(civetweb) |
3178
6d558598d713
Fix build with unpatched versions of Civetweb (missing "mg_disable_keep_alive()")
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3133
diff
changeset
|
68 |
6d558598d713
Fix build with unpatched versions of Civetweb (missing "mg_disable_keep_alive()")
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3133
diff
changeset
|
69 add_definitions( |
6d558598d713
Fix build with unpatched versions of Civetweb (missing "mg_disable_keep_alive()")
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3133
diff
changeset
|
70 -DCIVETWEB_HAS_DISABLE_KEEP_ALIVE=0 |
6d558598d713
Fix build with unpatched versions of Civetweb (missing "mg_disable_keep_alive()")
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3133
diff
changeset
|
71 ) |
2377
32bea64e070b
Experimental support of actively maintained Civetweb to replace Mongoose 3.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
72 endif() |