mirror of
https://github.com/kakwa/uts-server
synced 2025-01-24 20:37:27 +01:00
implementing a way to recover civetweb as an external project
This commit is contained in:
parent
e3a631f41b
commit
5e91614dd4
3
.gitignore
vendored
3
.gitignore
vendored
@ -50,3 +50,6 @@ tests/cfg/pki/.rnd
|
|||||||
|
|
||||||
# pid file
|
# pid file
|
||||||
*.pid
|
*.pid
|
||||||
|
|
||||||
|
# civetweb build directory
|
||||||
|
civetweb-prefix/
|
||||||
|
@ -1,9 +1,13 @@
|
|||||||
cmake_minimum_required (VERSION 2.6)
|
cmake_minimum_required (VERSION 2.6)
|
||||||
project (uts-server)
|
project (uts-server)
|
||||||
|
include(ExternalProject)
|
||||||
|
|
||||||
|
|
||||||
set(VERSION 0.1.0)
|
set(VERSION 0.1.0)
|
||||||
|
|
||||||
option(DEBUG "compile with debug symbol" OFF)
|
option(DEBUG "compile with debug symbol" OFF)
|
||||||
|
option(BUNDLE_CIVETWEB "bundle civetweb with uts-server" OFF)
|
||||||
|
|
||||||
if(DEBUG)
|
if(DEBUG)
|
||||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O0 -g")
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O0 -g")
|
||||||
set(CMAKE_BUILD_TYPE Debug)
|
set(CMAKE_BUILD_TYPE Debug)
|
||||||
@ -19,14 +23,34 @@ set(CMAKE_C_FLAGS "${CMAKE_CXX_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(libcivetweb REQUIRED)
|
|
||||||
MESSAGE( STATUS "Find Header Directory for libcivetweb: " ${LIBCIVETWEB_INCLUDE_DIR})
|
if(BUNDLE_CIVETWEB)
|
||||||
MESSAGE( STATUS "Find Dynamic Library for libcivetweb: " ${LIBCIVETWEB_LIBRARIES})
|
ExternalProject_Add( civetweb
|
||||||
|
GIT_REPOSITORY https://github.com/civetweb/civetweb
|
||||||
|
GIT_TAG v1.8
|
||||||
|
INSTALL_DIR /usr/local
|
||||||
|
CMAKE_ARGS .. -DCMAKE_INSTALL_PREFIX=/usr
|
||||||
|
-DCIVETWEB_DISABLE_CGI=ON
|
||||||
|
-DCIVETWEB_ENABLE_CXX=OFF
|
||||||
|
-DBUILD_SHARED_LIBS=OFF
|
||||||
|
-DCIVETWEB_DISABLE_CGI=ON
|
||||||
|
-DCIVETWEB_SERVE_NO_FILES=ON
|
||||||
|
-DBUILD_TESTING=OFF
|
||||||
|
INSTALL_COMMAND make install DESTDIR=${CMAKE_CURRENT_SOURCE_DIR}/vendor/
|
||||||
|
)
|
||||||
|
set(LIBCIVETWEB_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/vendor/usr/include")
|
||||||
|
set(LIBCIVETWEB_LIBRARIES "${CMAKE_CURRENT_SOURCE_DIR}/vendor/usr/lib/libcivetweb.a")
|
||||||
|
set (CMAKE_C_LINK_EXECUTABLE "${CMAKE_CXX_LINK_EXECUTABLE} -ldl -lpthread")
|
||||||
|
else(BUNDLE_CIVETWEB)
|
||||||
|
find_package(libcivetweb REQUIRED)
|
||||||
|
endif(BUNDLE_CIVETWEB)
|
||||||
|
|
||||||
find_package(OpenSSL REQUIRED)
|
find_package(OpenSSL REQUIRED)
|
||||||
MESSAGE( STATUS "OpenSSL include dir: ${OPENSSL_INCLUDE_DIR}")
|
MESSAGE(STATUS "OpenSSL include dir: ${OPENSSL_INCLUDE_DIR}")
|
||||||
MESSAGE( STATUS "OpenSSL libraries: ${OPENSSL_LIBRARIES}")
|
MESSAGE(STATUS "OpenSSL libraries: ${OPENSSL_LIBRARIES}")
|
||||||
|
|
||||||
|
MESSAGE( STATUS "Find Header Directory for libcivetweb: " ${LIBCIVETWEB_INCLUDE_DIR})
|
||||||
|
MESSAGE( STATUS "Find Dynamic Library for libcivetweb: " ${LIBCIVETWEB_LIBRARIES})
|
||||||
include_directories(
|
include_directories(
|
||||||
./inc/
|
./inc/
|
||||||
${LIBCIVETWEB_INCLUDE_DIR}
|
${LIBCIVETWEB_INCLUDE_DIR}
|
||||||
@ -41,8 +65,8 @@ add_executable(uts-server
|
|||||||
)
|
)
|
||||||
|
|
||||||
target_link_libraries(uts-server
|
target_link_libraries(uts-server
|
||||||
${LIBCIVETWEB_LIBRARIES}
|
|
||||||
${OPENSSL_LIBRARIES}
|
${OPENSSL_LIBRARIES}
|
||||||
|
${LIBCIVETWEB_LIBRARIES}
|
||||||
)
|
)
|
||||||
|
|
||||||
INSTALL(TARGETS uts-server
|
INSTALL(TARGETS uts-server
|
||||||
|
Loading…
x
Reference in New Issue
Block a user