Преглед изворни кода

Merge branch 'master' of https://github.com/civetweb/civetweb

bel2125 пре 4 година
родитељ
комит
737495f268
2 измењених фајлова са 14 додато и 1 уклоњено
  1. 8 1
      CMakeLists.txt
  2. 6 0
      src/CMakeLists.txt

+ 8 - 1
CMakeLists.txt

@@ -1,5 +1,5 @@
 # Determines what CMake APIs we can rely on
-cmake_minimum_required (VERSION 2.8.11)
+cmake_minimum_required (VERSION 2.8.12)
 if (${CMAKE_VERSION} VERSION_GREATER 3.2.2)
   cmake_policy(VERSION 3.2.2)
 endif()
@@ -112,6 +112,10 @@ message(STATUS "Force x32 / x64 architecture - ${CIVETWEB_ARCH}")
 option(CIVETWEB_ENABLE_LUA "Enable Lua CGIs" OFF)
 message(STATUS "Lua CGI support - ${CIVETWEB_ENABLE_LUA}")
 
+# zlib compression support
+option(CIVETWEB_ENABLE_ZLIB "Enables zlib compression support" OFF)
+message(STATUS "zlib support - ${CIVETWEB_ENABLE_ZLIB}")
+
 # Enable installing CivetWeb executables
 option(CIVETWEB_INSTALL_EXECUTABLE "Enable installing CivetWeb executable" ON)
 mark_as_advanced(FORCE CIVETWEB_INSTALL_EXECUTABLE) # Advanced users can disable
@@ -508,6 +512,9 @@ endif()
 if (CIVETWEB_ENABLE_LUA)
   add_definitions(-DUSE_LUA)
 endif()
+if (CIVETWEB_ENABLE_ZLIB)
+  add_definitions(-DUSE_ZLIB)
+endif()
 if (CIVETWEB_ENABLE_DUKTAPE)
   add_definitions(-DUSE_DUKTAPE)
 endif()

+ 6 - 0
src/CMakeLists.txt

@@ -246,6 +246,12 @@ if (CIVETWEB_ENABLE_LUA)
   target_link_libraries(civetweb-c-library ${LUA_LIBRARIES})
 endif()
 
+if (CIVETWEB_ENABLE_ZLIB)
+  find_package(ZLIB)
+  include_directories(${ZLIB_INCLUDE_DIRS})
+  target_link_libraries(civetweb-c-library ${ZLIB_LIBRARIES})
+endif()
+
 # The web server executable
 if (CIVETWEB_ENABLE_SERVER_EXECUTABLE)
     add_executable(civetweb-c-executable main.c)