From e1d3869fb3c68dfcc905c437c031df734bea41bf Mon Sep 17 00:00:00 2001 From: mpromonet Date: Sat, 2 Mar 2024 19:22:04 +0100 Subject: [PATCH] try to improve ssl detection --- CMakeLists.txt | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 2f85a4b..a5d8e9a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -21,7 +21,7 @@ target_include_directories(liblive555helper PUBLIC ${LIVE}/groupsock/include ${L if (WIN32) target_compile_definitions(liblive555helper PUBLIC _CRT_SECURE_NO_WARNINGS=1 NO_GETIFADDRS=1) - target_link_libraries (liblive555helper ws2_32) + target_link_libraries (liblive555helper PUBLIC ws2_32) elseif (APPLE) target_compile_definitions(liblive555helper PUBLIC BSD=1 SOCKLEN_T=socklen_t _FILE_OFFSET_BITS=64 _LARGEFILE_SOURCE=1 NO_STD_LIB=1 NEED_XLOCALE_H=1) else () @@ -33,15 +33,15 @@ if (DETECT_OPENSSL) find_package(OpenSSL QUIET) endif() MESSAGE("OpenSSL_FOUND = ${OpenSSL_FOUND}") -if (NOT OpenSSL_FOUND) +if (OpenSSL_FOUND) + target_include_directories(liblive555helper PUBLIC ${OPENSSL_INCLUDE_DIR}) + target_link_libraries(liblive555helper PUBLIC ${OPENSSL_LIBRARIES}) +else() target_compile_definitions(liblive555helper PUBLIC NO_OPENSSL=1) endif() add_executable (${PROJECT_NAME} main.cpp) target_link_libraries (${PROJECT_NAME} liblive555helper) -if (OpenSSL_FOUND) - target_link_libraries (${PROJECT_NAME} OpenSSL::SSL OpenSSL::Crypto) -endif() SET(CPACK_GENERATOR "TGZ") SET(CPACK_PACKAGE_CONTACT "michel.promonet@free.fr")