Mercurial > hg > orthanc
changeset 4210:7b14ddf795c5
auto-detection of mg_disable_keep_alive() in CMake
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Mon, 21 Sep 2020 11:20:08 +0200 |
parents | c3fc0b884442 |
children | afad57ac30ef |
files | OrthancFramework/Resources/CMake/CivetwebConfiguration.cmake |
diffstat | 1 files changed, 14 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- a/OrthancFramework/Resources/CMake/CivetwebConfiguration.cmake Fri Sep 18 16:23:07 2020 +0200 +++ b/OrthancFramework/Resources/CMake/CivetwebConfiguration.cmake Mon Sep 21 11:20:08 2020 +0200 @@ -93,20 +93,29 @@ else() CHECK_INCLUDE_FILE_CXX(civetweb.h HAVE_CIVETWEB_H) if (NOT HAVE_CIVETWEB_H) - message(FATAL_ERROR "Please install the libcivetweb-devel package") + message(FATAL_ERROR "Please install the libcivetweb-dev package") endif() cmake_reset_check_state() set(CMAKE_REQUIRED_LIBRARIES dl pthread) CHECK_LIBRARY_EXISTS(civetweb mg_start "" HAVE_CIVETWEB_LIB) if (NOT HAVE_CIVETWEB_LIB) - message(FATAL_ERROR "Please install the libcivetweb-devel package") + message(FATAL_ERROR "Please install the libcivetweb-dev package") endif() link_libraries(civetweb) unset(CMAKE_REQUIRED_LIBRARIES) - add_definitions( - -DCIVETWEB_HAS_DISABLE_KEEP_ALIVE=0 - ) + # Check whether the system distribution of civetweb contains the + # patch "../Patches/civetweb-1.12.patch" that allows to disable + # keep-alive on selected HTTP connections. This is useful to speed + # up multipart transfers, as encountered in DICOMweb. + CHECK_LIBRARY_EXISTS(civetweb mg_disable_keep_alive "" CIVETWEB_HAS_DISABLE_KEEP_ALIVE) + if (CIVETWEB_HAS_DISABLE_KEEP_ALIVE) + add_definitions(-DCIVETWEB_HAS_DISABLE_KEEP_ALIVE=1) + message("Performance: Your system-wide distribution of civetweb is configured for best performance") + else() + message(WARNING "Performance: Your system-wide distribution of civetweb does not feature the mg_disable_keep_alive() function") + add_definitions(-DCIVETWEB_HAS_DISABLE_KEEP_ALIVE=0) + endif() endif()