From 7a5389b719764189c982bad2573fea73caaa2cf7 Mon Sep 17 00:00:00 2001 From: olszomal Date: Wed, 10 Apr 2024 15:50:58 +0200 Subject: [PATCH] Fixed cmake test cURL support --- CMakeLists.txt | 8 +++++--- cmake/CMakeTest.cmake | 6 +++--- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 37d2537..a92d733 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -66,14 +66,16 @@ target_include_directories(osslsigncode PRIVATE ${OPENSSL_INCLUDE_DIR}) target_link_libraries(osslsigncode PRIVATE ${OPENSSL_LIBRARIES}) # set cURL includes/libraries -if(OPENSSL_VERSION VERSION_LESS "3.0.0" AND CURL_FOUND) +if(OPENSSL_VERSION VERSION_LESS "3.0.0") +if(CURL_FOUND) target_compile_definitions(osslsigncode PRIVATE ENABLE_CURL=1) target_include_directories(osslsigncode PRIVATE ${CURL_INCLUDE_DIRS}) target_link_libraries(osslsigncode PRIVATE ${CURL_LIBRARIES}) message(STATUS "cURL support enabled") -else(OPENSSL_VERSION VERSION_LESS "3.0.0" AND CURL_FOUND) +else(CURL_FOUND) message(STATUS "cURL support disabled (library not found)") -endif(OPENSSL_VERSION VERSION_LESS "3.0.0" AND CURL_FOUND) +endif(CURL_FOUND) +endif(OPENSSL_VERSION VERSION_LESS "3.0.0") if(NOT ZLIB_FOUND) message(FATAL_ERROR "Zlib library not found") diff --git a/cmake/CMakeTest.cmake b/cmake/CMakeTest.cmake index de3a10d..4cdba1a 100644 --- a/cmake/CMakeTest.cmake +++ b/cmake/CMakeTest.cmake @@ -454,7 +454,7 @@ foreach(file ${files}) endforeach(file ${files}) -if((Python3_FOUND OR server_error) AND CURL_FOUND) +if((Python3_FOUND OR server_error) AND (OPENSSL_VERSION VERSION_GREATER_EQUAL "3.0.0" OR CURL_FOUND)) ### Sign with Time-Stamp Authority ### @@ -724,9 +724,9 @@ endforeach(ext ${extensions_nocat}) message(STATUS "Keep HTTP server after tests") endif(STOP_SERVER) -else((Python3_FOUND OR server_error) AND CURL_FOUND) +else((Python3_FOUND OR server_error) AND (OPENSSL_VERSION VERSION_GREATER_EQUAL "3.0.0" OR CURL_FOUND)) message(STATUS "CTest skips some tests") -endif((Python3_FOUND OR server_error) AND CURL_FOUND) +endif((Python3_FOUND OR server_error) AND (OPENSSL_VERSION VERSION_GREATER_EQUAL "3.0.0" OR CURL_FOUND)) # Delete test files set(names "legacy" "signed" "signed_crldp" "nested" "revoked" "removed" "added")