From 97470b102a4fbe253f7d42c8a34d3377bef668b3 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Fri, 30 Aug 2019 08:25:13 +0000 Subject: Complete mod_md CMake config by adding a _requires iterator, using the official curl FIND_PACKAGE logic and completing the jansson detection logic. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1866131 13f79535-47bb-0310-9956-ffa450edef68 --- CMakeLists.txt | 45 ++++++++++++++++++++------------------------- 1 file changed, 20 insertions(+), 25 deletions(-) (limited to 'CMakeLists.txt') diff --git a/CMakeLists.txt b/CMakeLists.txt index de746d271a..546afe1a67 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -26,6 +26,7 @@ FIND_PACKAGE(LibXml2) FIND_PACKAGE(Lua51) FIND_PACKAGE(OpenSSL) FIND_PACKAGE(ZLIB) +FIND_PACKAGE(CURL) # Options for support libraries not supported by cmake-bundled FindFOO @@ -70,12 +71,6 @@ ELSE() SET(default_check_libraries) ENDIF() -IF(EXISTS "${CMAKE_INSTALL_PREFIX}/lib/curl.lib") - SET(default_curl_libraries "${CMAKE_INSTALL_PREFIX}/lib/curl.lib") -ELSE() - SET(default_curl_libraries) -ENDIF() - IF(EXISTS "${CMAKE_INSTALL_PREFIX}/lib/jansson.lib") SET(default_jansson_libraries "${CMAKE_INSTALL_PREFIX}/lib/jansson.lib") ELSE() @@ -92,10 +87,10 @@ SET(LIBXML2_ICONV_INCLUDE_DIR "" CACHE STRING "Directory SET(LIBXML2_ICONV_LIBRARIES "" CACHE STRING "iconv libraries to link with for libxml2") SET(BROTLI_INCLUDE_DIR "${CMAKE_INSTALL_PREFIX}/include" CACHE STRING "Directory with include files for Brotli") SET(BROTLI_LIBRARIES ${default_brotli_libraries} CACHE STRING "Brotli libraries to link with") +SET(JANSSON_INCLUDE_DIR "${CMAKE_INSTALL_PREFIX}/include" CACHE STRING "Directory with include files for jansson") +SET(JANSSON_LIBRARIES "${default_jansson_libraries}" CACHE STRING "Jansson libraries to link with") SET(CHECK_INCLUDE_DIR "${CMAKE_INSTALL_PREFIX}/include" CACHE STRING "Directory with include files for Check") SET(CHECK_LIBRARIES "${default_check_libraries}" CACHE STRING "Check libraries to link with") -SET(CURL_LIBRARIES "${default_curl_libraries}" CACHE STRING "Curl libraries to link with") -SET(JANSSON_LIBRARIES "${default_jansson_libraries}" CACHE STRING "Jansson libraries to link with") # end support library configuration # Misc. options @@ -245,16 +240,16 @@ ELSE() SET(CHECK_FOUND FALSE) ENDIF() -# See if we have curl -SET(CURL_FOUND TRUE) -IF(EXISTS "${CURL_INCLUDE_DIR}/curl/curl.h") - FOREACH(onelib ${CURL_LIBRARIES}) +# See if we have Jansson +SET(JANSSON_FOUND TRUE) +IF(EXISTS "${JANSSON_INCLUDE_DIR}/jansson.h") + FOREACH(onelib ${JANSSON_LIBRARIES}) IF(NOT EXISTS ${onelib}) - SET(CURL_FOUND FALSE) + SET(JANSSON_FOUND FALSE) ENDIF() ENDFOREACH() ELSE() - SET(CURL_FOUND FALSE) + SET(JANSSON_FOUND FALSE) ENDIF() @@ -508,9 +503,7 @@ SET(mod_lua_extra_sources modules/lua/lua_vmprep.c modules/lua/lua_dbd.c ) SET(mod_lua_requires LUA51_FOUND) -# TODO: _requires does not currently iterate a list, substitute the following once it does; -# SET(mod_md_requires OPENSSL_FOUND CURL_FOUND JANSSON_FOUND HAVE_OPENSSL_102) -SET(mod_md_requires CURL_FOUND) +SET(mod_md_requires OPENSSL_FOUND CURL_FOUND JANSSON_FOUND) SET(mod_md_extra_includes ${OPENSSL_INCLUDE_DIR} ${CURL_INCLUDE_DIR} ${JANSSON_INCLUDE_DIR}) SET(mod_md_extra_libs ${OPENSSL_LIBRARIES} ${CURL_LIBRARIES} ${JANSSON_LIBRARIES} mod_watchdog) SET(mod_md_extra_sources @@ -828,15 +821,17 @@ FOREACH (mod ${MODULE_PATHS}) IF(NOT ${enable_mod_val} STREQUAL "O") # build of module is desired SET(mod_requires "${mod_name}_requires") STRING(TOUPPER ${enable_mod_val} enable_mod_val_upper) - IF(NOT ${${mod_requires}} STREQUAL "") # module has some prerequisite - IF(NOT ${${mod_requires}}) # prerequisite doesn't exist - IF(NOT ${enable_mod_val} STREQUAL ${enable_mod_val_upper}) # lower case, so optional based on prereq - MESSAGE(STATUS "${mod_name} was requested but couldn't be built due to a missing prerequisite (${${mod_requires}})") - SET(enable_mod_val_upper "O") # skip due to missing prerequisite - ELSE() # must be upper case "A" or "I" (or coding error above) - MESSAGE(FATAL_ERROR "${mod_name} was requested but couldn't be built due to a missing prerequisite (${${mod_requires}})") + IF(NOT "${${mod_requires}}" STREQUAL "") # module has some prerequisite + FOREACH (required ${${mod_requires}}) + IF(NOT ${required}) # prerequisite doesn't exist + IF(NOT ${enable_mod_val} STREQUAL ${enable_mod_val_upper}) # lower case, so optional based on prereq + MESSAGE(STATUS "${mod_name} was requested but couldn't be built due to a missing prerequisite (${required})") + SET(enable_mod_val_upper "O") # skip due to missing prerequisite + ELSE() # must be upper case "A" or "I" (or coding error above) + MESSAGE(FATAL_ERROR "${mod_name} was requested but couldn't be built due to a missing prerequisite (${required})") + ENDIF() ENDIF() - ENDIF() + ENDFOREACH() ENDIF() # map a->A, i->I, O->O for remaining logic since prereq checking is over SET(enable_mod_val ${enable_mod_val_upper}) -- cgit v1.2.1