From: William A. Rowe Jr Date: Fri, 30 Aug 2019 08:28:35 +0000 (+0000) Subject: Complete mod_md CMake config by adding a _requires iterator, using the official X-Git-Tag: 2.4.42~271 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=426c616ad57fc77ea6bc47f42d63f4b77132d53a;p=thirdparty%2Fapache%2Fhttpd.git Complete mod_md CMake config by adding a _requires iterator, using the official curl FIND_PACKAGE logic and completing the jansson detection logic. Backports: r1866131 git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1866132 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/CMakeLists.txt b/CMakeLists.txt index 7a6c4b2651a..075c7e06349 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 @@ -64,12 +65,6 @@ ELSE() SET(default_brotli_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() @@ -86,7 +81,7 @@ 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(CURL_LIBRARIES "${default_curl_libraries}" CACHE STRING "Curl 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") # end support library configuration @@ -213,16 +208,16 @@ ELSE() SET(BROTLI_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() @@ -470,9 +465,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 @@ -770,15 +763,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})