diff --git a/CMakeLists.txt b/CMakeLists.txt index e410db70..62334aed 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -175,16 +175,16 @@ if (USE_TLS) endif() message(STATUS "OpenSSL: " ${OPENSSL_VERSION}) - target_link_libraries(ixwebsocket OpenSSL::SSL OpenSSL::Crypto) + target_link_libraries(ixwebsocket PUBLIC OpenSSL::SSL OpenSSL::Crypto) elseif (USE_MBED_TLS) message(STATUS "TLS configured to use mbedtls") find_package(MbedTLS REQUIRED) target_include_directories(ixwebsocket PUBLIC ${MBEDTLS_INCLUDE_DIRS}) - target_link_libraries(ixwebsocket ${MBEDTLS_LIBRARIES}) + target_link_libraries(ixwebsocket PUBLIC ${MBEDTLS_LIBRARIES}) elseif (USE_SECURE_TRANSPORT) message(STATUS "TLS configured to use secure transport") - target_link_libraries(ixwebsocket "-framework foundation" "-framework security") + target_link_libraries(ixwebsocket PUBLIC "-framework foundation" "-framework security") endif() endif() @@ -194,25 +194,25 @@ if (NOT ZLIB_FOUND) endif() if (ZLIB_FOUND) include_directories(${ZLIB_INCLUDE_DIRS}) - target_link_libraries(ixwebsocket ${ZLIB_LIBRARIES}) + target_link_libraries(ixwebsocket PUBLIC ${ZLIB_LIBRARIES}) else() include_directories(third_party/zlib ${CMAKE_CURRENT_BINARY_DIR}/third_party/zlib) - add_subdirectory(third_party/zlib) - target_link_libraries(ixwebsocket zlibstatic) + add_subdirectory(third_party/zlib EXCLUDE_FROM_ALL) + target_link_libraries(ixwebsocket PRIVATE $) endif() if (WIN32) - target_link_libraries(ixwebsocket wsock32 ws2_32 shlwapi) + target_link_libraries(ixwebsocket PUBLIC wsock32 ws2_32 shlwapi) add_definitions(-D_CRT_SECURE_NO_WARNINGS) if (USE_TLS) - target_link_libraries(ixwebsocket Crypt32) + target_link_libraries(ixwebsocket PUBLIC Crypt32) endif() endif() if (UNIX) find_package(Threads) - target_link_libraries(ixwebsocket ${CMAKE_THREAD_LIBS_INIT}) + target_link_libraries(ixwebsocket PUBLIC ${CMAKE_THREAD_LIBS_INIT}) endif()