Revert "Merge pull request #2637 from kkartaltepe/cmake-variety-fixes"

This reverts commit d777000a60, reversing
changes made to c9e5f30a78.
This commit is contained in:
jp9000
2020-05-21 00:03:09 -07:00
parent d777000a60
commit 8d6f29ffc7
11 changed files with 82 additions and 61 deletions

View File

@@ -5,21 +5,22 @@ set_property(CACHE WITH_RTMPS PROPERTY STRINGS AUTO ON OFF)
option(STATIC_MBEDTLS "Statically link mbedTLS into binary" OFF)
if (WITH_RTMPS STREQUAL "AUTO")
find_package(MbedTLS)
find_package(ZLIB)
if (NOT MBEDTLS_FOUND OR NOT ZLIB_FOUND)
set(WITH_RTMPS "OFF")
message(WARNING "mbedTLS or zlib was not found, RTMPS will be auto-disabled")
endif()
if (WITH_RTMPS OR (WITH_RTMPS STREQUAL "AUTO"))
find_package(MbedTLS QUIET)
find_package(ZLIB QUIET)
endif()
if (WITH_RTMPS)
find_package(MbedTLS REQUIRED)
find_package(ZLIB REQUIRED)
if (LIBMBEDTLS_FOUND AND ZLIB_FOUND)
add_definitions(-DCRYPTO -DUSE_MBEDTLS)
include_directories(${MBEDTLS_INCLUDE_DIRS} ${ZLIB_INCLUDE_DIRS})
include_directories(${LIBMBEDTLS_INCLUDE_DIRS} ${ZLIB_INCLUDE_DIRS})
else()
if(WITH_RTMPS STREQUAL "AUTO")
message(WARNING "mbedTLS was not found, RTMPS will be auto-disabled")
elseif (WITH_RTMPS)
message(FATAL_ERROR "RTMPS enabled by user, but mbedTLS was not found")
endif()
unset(LIBMBEDTLS_LIBRARIES)
unset(ZLIB_LIBRARIES)
add_definitions(-DNO_CRYPTO)
endif()
@@ -171,7 +172,7 @@ add_library(obs-outputs MODULE
${obs-outputs_librtmp_HEADERS})
target_link_libraries(obs-outputs
libobs
${MBEDTLS_LIBRARIES}
${LIBMBEDTLS_LIBRARIES}
${ZLIB_LIBRARIES}
${ftl_IMPORTS}
${obs-outputs_PLATFORM_DEPS})