Skip to content

Commit

Permalink
Fixed cmake test cURL support
Browse files Browse the repository at this point in the history
  • Loading branch information
olszomal authored and mtrojnar committed Apr 10, 2024
1 parent d9f0a8d commit 7a5389b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
8 changes: 5 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
6 changes: 3 additions & 3 deletions cmake/CMakeTest.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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 ###

Expand Down Expand Up @@ -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")
Expand Down

0 comments on commit 7a5389b

Please sign in to comment.