1
0
mirror of https://github.com/kakwa/uts-server synced 2024-11-05 09:18:50 +01:00

add step in CMakeLists.txt to adapt civetweb Bundling to openssl

versions
This commit is contained in:
kakwa 2016-12-22 03:12:49 +01:00
parent c697886620
commit 69998f94d1

View File

@ -25,11 +25,20 @@ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DUTS_VERSION='\"${VERSION}\"'")
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/cmake/") set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/cmake/")
find_package(OpenSSL REQUIRED)
MESSAGE(STATUS "OpenSSL include dir: ${OPENSSL_INCLUDE_DIR}")
MESSAGE(STATUS "OpenSSL libraries: ${OPENSSL_LIBRARIES}")
MESSAGE(STATUS "OpenSSL version: ${OPENSSL_VERSION}")
if(${OPENSSL_VERSION} VERSION_GREATER 1.0.1)
set(OPENSSL_API_1_1 ON)
else()
set(OPENSSL_API_1_1 OFF)
endif()
if(BUNDLE_CIVETWEB) if(BUNDLE_CIVETWEB)
ExternalProject_Add( civetweb ExternalProject_Add( civetweb
GIT_REPOSITORY https://github.com/civetweb/civetweb GIT_REPOSITORY https://github.com/kakwa/civetweb
GIT_TAG v1.8
PATCH_COMMAND sed -i s/__DATE__/"110973"/ src/main.c PATCH_COMMAND sed -i s/__DATE__/"110973"/ src/main.c
INSTALL_DIR /usr/local INSTALL_DIR /usr/local
CMAKE_ARGS .. -DCMAKE_INSTALL_PREFIX=/usr CMAKE_ARGS .. -DCMAKE_INSTALL_PREFIX=/usr
@ -38,7 +47,11 @@ if(BUNDLE_CIVETWEB)
-DBUILD_SHARED_LIBS=OFF -DBUILD_SHARED_LIBS=OFF
-DCIVETWEB_DISABLE_CGI=ON -DCIVETWEB_DISABLE_CGI=ON
-DCIVETWEB_SERVE_NO_FILES=ON -DCIVETWEB_SERVE_NO_FILES=ON
-DCIVETWEB_ENABLE_IPV6=ON
-DCIVETWEB_DISABLE_CACHING=ON
-DBUILD_TESTING=OFF -DBUILD_TESTING=OFF
-DCIVETWEB_SSL_OPENSSL_API_1_1=${OPENSSL_API_1_1}
-DCIVETWEB_ENABLE_SSL_DYNAMIC_LOADING=OFF
INSTALL_COMMAND make install DESTDIR=${CMAKE_CURRENT_SOURCE_DIR}/vendor/ INSTALL_COMMAND make install DESTDIR=${CMAKE_CURRENT_SOURCE_DIR}/vendor/
) )
set(LIBCIVETWEB_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/vendor/usr/include") set(LIBCIVETWEB_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/vendor/usr/include")
@ -48,10 +61,6 @@ else(BUNDLE_CIVETWEB)
find_package(libcivetweb REQUIRED) find_package(libcivetweb REQUIRED)
endif(BUNDLE_CIVETWEB) endif(BUNDLE_CIVETWEB)
find_package(OpenSSL REQUIRED)
MESSAGE(STATUS "OpenSSL include dir: ${OPENSSL_INCLUDE_DIR}")
MESSAGE(STATUS "OpenSSL libraries: ${OPENSSL_LIBRARIES}")
MESSAGE( STATUS "Find Header Directory for libcivetweb: " ${LIBCIVETWEB_INCLUDE_DIR}) MESSAGE( STATUS "Find Header Directory for libcivetweb: " ${LIBCIVETWEB_INCLUDE_DIR})
MESSAGE( STATUS "Find Dynamic Library for libcivetweb: " ${LIBCIVETWEB_LIBRARIES}) MESSAGE( STATUS "Find Dynamic Library for libcivetweb: " ${LIBCIVETWEB_LIBRARIES})
include_directories( include_directories(