comparison Resources/CMake/CivetwebConfiguration.cmake @ 2377:32bea64e070b

Experimental support of actively maintained Civetweb to replace Mongoose 3.8
author Sebastien Jodogne <s.jodogne@gmail.com>
date Mon, 28 Aug 2017 14:09:24 +0200
parents
children 116ade1eff82
comparison
equal deleted inserted replaced
2376:c33ff8a7ffa9 2377:32bea64e070b
1 if (STATIC_BUILD OR NOT USE_SYSTEM_CIVETWEB)
2 set(CIVETWEB_SOURCES_DIR ${CMAKE_BINARY_DIR}/civetweb-1.9.1)
3 set(CIVETWEB_URL "http://www.orthanc-server.com/downloads/third-party/civetweb-1.9.1.tar.gz")
4 set(CIVETWEB_MD5 "c713f7336582d1a78897971260c67c2a")
5
6 DownloadPackage(${CIVETWEB_MD5} ${CIVETWEB_URL} "${CIVETWEB_SOURCES_DIR}")
7
8 include_directories(
9 ${CIVETWEB_SOURCES_DIR}/src
10 )
11
12 set(CIVETWEB_SOURCES
13 ${CIVETWEB_SOURCES_DIR}/src/civetweb.c
14 )
15
16
17 if (ENABLE_SSL)
18 add_definitions(
19 -DNO_SSL_DL=1
20 )
21 if (${CMAKE_SYSTEM_NAME} STREQUAL "Linux" OR
22 ${CMAKE_SYSTEM_NAME} STREQUAL "kFreeBSD")
23 link_libraries(dl)
24 endif()
25
26 else()
27 add_definitions(
28 -DNO_SSL=1 # Remove SSL support from civetweb
29 )
30 endif()
31
32
33 if (CMAKE_SYSTEM_NAME STREQUAL "Windows" AND
34 CMAKE_COMPILER_IS_GNUCXX)
35 # This is a patch for MinGW64
36 add_definitions(-D_TIMESPEC_DEFINED=1)
37 endif()
38
39 source_group(ThirdParty\\Civetweb REGULAR_EXPRESSION ${CIVETWEB_SOURCES_DIR}/.*)
40
41 else()
42 include(CMakePushCheckState)
43
44 CHECK_INCLUDE_FILE_CXX(civetweb.h HAVE_CIVETWEB_H)
45 if (NOT HAVE_CIVETWEB_H)
46 message(FATAL_ERROR "Please install the libcivetweb-devel package")
47 endif()
48
49 cmake_reset_check_state()
50 set(CMAKE_REQUIRED_LIBRARIES dl pthread)
51 CHECK_LIBRARY_EXISTS(civetweb mg_start "" HAVE_CIVETWEB_LIB)
52 if (NOT HAVE_CIVETWEB_LIB)
53 message(FATAL_ERROR "Please install the libcivetweb-devel package")
54 endif()
55
56 link_libraries(civetweb)
57 endif()