Fix LibeventConfig.cmake in case of no OpenSSL

Previously it fails with, due to empty OPENSSL_FOUND:

    CMake Error at /home/runner/work/libevent/libevent/build/LibeventConfig.cmake:64 (if):
      if given arguments:

        "3.30.3" "VERSION_LESS" "3.15.0" "AND" "1" "AND" "AND" "TRUE"

      Unknown arguments specified
This commit is contained in:
Azat Khuzhin 2024-10-03 21:31:12 +02:00
parent 68e18761ae
commit e23924c293

View File

@ -61,7 +61,7 @@ if(${LIBEVENT_STATIC_LINK})
set(_AVAILABLE_LIBS "${LIBEVENT_STATIC_LIBRARIES}")
# CMake before 3.15 doesn't link OpenSSL to pthread/dl, do it ourselves instead
if (${CMAKE_VERSION} VERSION_LESS "3.15.0" AND ${LIBEVENT_STATIC_LINK} AND ${OPENSSL_FOUND} AND ${Threads_FOUND})
if (${CMAKE_VERSION} VERSION_LESS "3.15.0" AND "${LIBEVENT_STATIC_LINK}" AND "${OPENSSL_FOUND}" AND "${Threads_FOUND}")
set_property(TARGET OpenSSL::Crypto APPEND PROPERTY INTERFACE_LINK_LIBRARIES Threads::Threads)
set_property(TARGET OpenSSL::Crypto APPEND PROPERTY INTERFACE_LINK_LIBRARIES ${CMAKE_DL_LIBS})
endif ()