annotate Resources/CMake/CivetwebConfiguration.cmake @ 2769:69ba05ac1894 Orthanc-1.3.1

close old branch
author Sebastien Jodogne <s.jodogne@gmail.com>
date Tue, 17 Jul 2018 09:44:29 +0200
parents 74d0953a3681
children ade8b4ddd8a6
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
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)
32bea64e070b Experimental support of actively maintained Civetweb to replace Mongoose 3.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2 set(CIVETWEB_SOURCES_DIR ${CMAKE_BINARY_DIR}/civetweb-1.9.1)
2384
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2383
diff changeset
3 set(CIVETWEB_URL "http://www.orthanc-server.com/downloads/third-party/civetweb-1.9.1.tar.gz")
2377
32bea64e070b Experimental support of actively maintained Civetweb to replace Mongoose 3.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4 set(CIVETWEB_MD5 "c713f7336582d1a78897971260c67c2a")
32bea64e070b Experimental support of actively maintained Civetweb to replace Mongoose 3.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5
32bea64e070b Experimental support of actively maintained Civetweb to replace Mongoose 3.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6 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
7
32bea64e070b Experimental support of actively maintained Civetweb to replace Mongoose 3.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8 include_directories(
2378
116ade1eff82 fix build
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 2377
diff changeset
9 ${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
10 )
32bea64e070b Experimental support of actively maintained Civetweb to replace Mongoose 3.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
11
32bea64e070b Experimental support of actively maintained Civetweb to replace Mongoose 3.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
12 set(CIVETWEB_SOURCES
32bea64e070b Experimental support of actively maintained Civetweb to replace Mongoose 3.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
13 ${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
14 )
32bea64e070b Experimental support of actively maintained Civetweb to replace Mongoose 3.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
15
32bea64e070b Experimental support of actively maintained Civetweb to replace Mongoose 3.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
16
32bea64e070b Experimental support of actively maintained Civetweb to replace Mongoose 3.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
17 if (ENABLE_SSL)
32bea64e070b Experimental support of actively maintained Civetweb to replace Mongoose 3.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
18 add_definitions(
32bea64e070b Experimental support of actively maintained Civetweb to replace Mongoose 3.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
19 -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
20 )
32bea64e070b Experimental support of actively maintained Civetweb to replace Mongoose 3.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
21 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
22 ${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
23 link_libraries(dl)
32bea64e070b Experimental support of actively maintained Civetweb to replace Mongoose 3.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
24 endif()
32bea64e070b Experimental support of actively maintained Civetweb to replace Mongoose 3.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
25
32bea64e070b Experimental support of actively maintained Civetweb to replace Mongoose 3.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
26 else()
32bea64e070b Experimental support of actively maintained Civetweb to replace Mongoose 3.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
27 add_definitions(
32bea64e070b Experimental support of actively maintained Civetweb to replace Mongoose 3.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
28 -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
29 )
32bea64e070b Experimental support of actively maintained Civetweb to replace Mongoose 3.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
30 endif()
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 (CMAKE_SYSTEM_NAME STREQUAL "Windows" AND
32bea64e070b Experimental support of actively maintained Civetweb to replace Mongoose 3.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
34 CMAKE_COMPILER_IS_GNUCXX)
32bea64e070b Experimental support of actively maintained Civetweb to replace Mongoose 3.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
35 # This is a patch for MinGW64
32bea64e070b Experimental support of actively maintained Civetweb to replace Mongoose 3.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
36 add_definitions(-D_TIMESPEC_DEFINED=1)
32bea64e070b Experimental support of actively maintained Civetweb to replace Mongoose 3.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
37 endif()
32bea64e070b Experimental support of actively maintained Civetweb to replace Mongoose 3.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
38
32bea64e070b Experimental support of actively maintained Civetweb to replace Mongoose 3.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
39 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
40
32bea64e070b Experimental support of actively maintained Civetweb to replace Mongoose 3.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
41 else()
32bea64e070b Experimental support of actively maintained Civetweb to replace Mongoose 3.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
42 include(CMakePushCheckState)
32bea64e070b Experimental support of actively maintained Civetweb to replace Mongoose 3.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
43
32bea64e070b Experimental support of actively maintained Civetweb to replace Mongoose 3.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
44 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
45 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
46 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
47 endif()
32bea64e070b Experimental support of actively maintained Civetweb to replace Mongoose 3.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
48
32bea64e070b Experimental support of actively maintained Civetweb to replace Mongoose 3.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
49 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
50 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
51 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
52 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
53 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
54 endif()
32bea64e070b Experimental support of actively maintained Civetweb to replace Mongoose 3.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
55
32bea64e070b Experimental support of actively maintained Civetweb to replace Mongoose 3.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
56 link_libraries(civetweb)
32bea64e070b Experimental support of actively maintained Civetweb to replace Mongoose 3.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
57 endif()