obs-outputs: Add USE_SSL option (disabled by default)
Closes jp9000/obs-studio#487
This commit is contained in:
parent
77c538bd33
commit
4b4ddbb33e
@ -22,6 +22,7 @@ endif()
|
||||
find_package(Libavcodec QUIET)
|
||||
find_package(Libx264 QUIET)
|
||||
find_package(Libfdk QUIET)
|
||||
find_package(ssl QUIET)
|
||||
find_package(Qt5Core QUIET)
|
||||
|
||||
file(GLOB FFMPEG_BIN_FILES
|
||||
@ -102,6 +103,16 @@ file(GLOB LIBFDK_BIN_FILES
|
||||
"${Libfdk_INCLUDE_DIR}/bin/libfdk*-*.dll"
|
||||
"${Libfdk_INCLUDE_DIR}/bin${_bin_suffix}/libfdk*-*.dll")
|
||||
|
||||
file(GLOB SSL_BIN_FILES
|
||||
"${SSL_INCLUDE_DIR}/../bin${_bin_suffix}/ssleay32*.dll"
|
||||
"${SSL_INCLUDE_DIR}/../bin${_bin_suffix}/libeay32*.dll"
|
||||
"${SSL_INCLUDE_DIR}/../bin/ssleay32*.dll"
|
||||
"${SSL_INCLUDE_DIR}/../bin/libeay32*.dll"
|
||||
"${SSL_INCLUDE_DIR}/bin${_bin_suffix}/ssleay32*.dll"
|
||||
"${SSL_INCLUDE_DIR}/bin${_bin_suffix}/libeay32*.dll"
|
||||
"${SSL_INCLUDE_DIR}/bin/ssleay32*.dll"
|
||||
"${SSL_INCLUDE_DIR}/bin/libeay32*.dll")
|
||||
|
||||
file(GLOB CURL_BIN_FILES
|
||||
"${CURL_INCLUDE_DIR}/../build/Win${_bin_suffix}/VC12/DLL Release - DLL Windows SSPI/libcurl.dll"
|
||||
"${CURL_INCLUDE_DIR}/../bin${_bin_suffix}/libcurl*.dll"
|
||||
@ -158,6 +169,7 @@ set(ALL_BASE_BIN_FILES
|
||||
${FFMPEG_BIN_FILES}
|
||||
${X264_BIN_FILES}
|
||||
${CURL_BIN_FILES}
|
||||
${SSL_BIN_FILES}
|
||||
${ZLIB_BIN_FILES}
|
||||
${LIBFDK_BIN_FILES}
|
||||
${FREETYPE_BIN_FILES}
|
||||
@ -190,6 +202,7 @@ message(STATUS "x264 files: ${X264_BIN_FILES}")
|
||||
message(STATUS "Libfdk files: ${LIBFDK_BIN_FILES}")
|
||||
message(STATUS "Freetype files: ${FREETYPE_BIN_FILES}")
|
||||
message(STATUS "curl files: ${CURL_BIN_FILES}")
|
||||
message(STATUS "ssl files: ${SSL_BIN_FILES}")
|
||||
message(STATUS "zlib files: ${ZLIB_BIN_FILES}")
|
||||
message(STATUS "QT Debug files: ${QT_DEBUG_BIN_FILES}")
|
||||
message(STATUS "QT Debug Platform files: ${QT_DEBUG_PLAT_BIN_FILES}")
|
||||
|
77
cmake/Modules/FindSSL.cmake
Normal file
77
cmake/Modules/FindSSL.cmake
Normal file
@ -0,0 +1,77 @@
|
||||
# Once done these will be defined:
|
||||
#
|
||||
# SSL_FOUND
|
||||
# SSL_INCLUDE_DIRS
|
||||
# SSL_LIBRARIES
|
||||
#
|
||||
# For use in OBS:
|
||||
#
|
||||
# SSL_INCLUDE_DIR
|
||||
|
||||
find_package(PkgConfig QUIET)
|
||||
if (PKG_CONFIG_FOUND)
|
||||
pkg_check_modules(_CRYPTO QUIET libcrypto)
|
||||
pkg_check_modules(_SSL QUIET libssl)
|
||||
endif()
|
||||
|
||||
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
|
||||
set(_lib_suffix 64)
|
||||
else()
|
||||
set(_lib_suffix 32)
|
||||
endif()
|
||||
|
||||
set(_SSL_BASE_HINTS
|
||||
ENV sslPath${_lib_suffix}
|
||||
ENV sslPath
|
||||
ENV DepsPath${_lib_suffix}
|
||||
ENV DepsPath
|
||||
${sslPath${_lib_suffix}}
|
||||
${sslPath}
|
||||
${DepsPath${_lib_suffix}}
|
||||
${DepsPath})
|
||||
|
||||
set(_SSL_LIB_SUFFIXES
|
||||
lib${_lib_suffix} lib
|
||||
libs${_lib_suffix} libs
|
||||
bin${_lib_suffix} bin
|
||||
../lib${_lib_suffix} ../lib
|
||||
../libs${_lib_suffix} ../libs
|
||||
../bin${_lib_suffix} ../bin)
|
||||
|
||||
find_path(SSL_INCLUDE_DIR
|
||||
NAMES openssl/ssl.h
|
||||
HINTS
|
||||
${_SSL_BASE_HINTS}
|
||||
${_CRYPTO_INCLUDE_DIRS}
|
||||
${_SSL_INCLUDE_DIRS}
|
||||
PATHS
|
||||
/usr/include /usr/local/include /opt/local/include /sw/include
|
||||
PATH_SUFFIXES
|
||||
include)
|
||||
|
||||
find_library(_SSL_LIB
|
||||
NAMES ${_SSL_LIBRARIES} ssleay32 ssl
|
||||
HINTS
|
||||
${_SSL_BASE_HINTS}
|
||||
${_SSL_LIBRARY_DIRS}
|
||||
PATHS
|
||||
/usr/lib /usr/local/lib /opt/local/lib /sw/lib
|
||||
PATH_SUFFIXES ${_SSL_LIB_SUFFIXES})
|
||||
|
||||
find_library(_CRYPTO_LIB
|
||||
NAMES ${_CRYPTO_LIBRARIES} libeay32 crypto
|
||||
HINTS
|
||||
${_SSL_BASE_HINTS}
|
||||
${_CRYPTO_LIBRARY_DIRS}
|
||||
PATHS
|
||||
/usr/lib /usr/local/lib /opt/local/lib /sw/lib
|
||||
PATH_SUFFIXES ${_SSL_LIB_SUFFIXES})
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(ssl DEFAULT_MSG _SSL_LIB _CRYPTO_LIB SSL_INCLUDE_DIR)
|
||||
mark_as_advanced(SSL_INCLUDE_DIR _SSL_LIB _CRYPTO_LIB)
|
||||
|
||||
if(SSL_FOUND)
|
||||
set(SSL_INCLUDE_DIRS ${SSL_INCLUDE_DIR})
|
||||
set(SSL_LIBRARIES ${_SSL_LIB} ${_CRYPTO_LIB})
|
||||
endif()
|
@ -1,5 +1,25 @@
|
||||
project(obs-outputs)
|
||||
|
||||
option(USE_SSL "Enable rtmps support with OpenSSL" OFF)
|
||||
|
||||
if (USE_SSL)
|
||||
find_package(SSL QUIET)
|
||||
find_package(ZLIB QUIET)
|
||||
endif()
|
||||
|
||||
if (SSL_FOUND AND ZLIB_FOUND)
|
||||
add_definitions(-DCRYPTO -DUSE_OPENSSL)
|
||||
include_directories(${SSL_INCLUDE_DIRS} ${ZLIB_INCLUDE_DIRS})
|
||||
else()
|
||||
if (USE_SSL)
|
||||
message(WARNING "SSL enabled by user, but OpenSSL was not found")
|
||||
endif()
|
||||
unset(SSL_LIBRARIES)
|
||||
unset(ZLIB_LIBRARIES)
|
||||
add_definitions(-DNO_CRYPTO)
|
||||
endif()
|
||||
|
||||
|
||||
if(WIN32)
|
||||
set(obs-outputs_PLATFORM_DEPS
|
||||
ws2_32
|
||||
@ -58,6 +78,8 @@ add_library(obs-outputs MODULE
|
||||
${obs-outputs_librtmp_HEADERS})
|
||||
target_link_libraries(obs-outputs
|
||||
libobs
|
||||
${SSL_LIBRARIES}
|
||||
${ZLIB_LIBRARIES}
|
||||
${obs-outputs_PLATFORM_DEPS})
|
||||
|
||||
install_obs_plugin_with_data(obs-outputs data)
|
||||
|
@ -25,8 +25,6 @@
|
||||
* http://www.gnu.org/copyleft/lgpl.html
|
||||
*/
|
||||
|
||||
#define NO_CRYPTO 1
|
||||
|
||||
#if !defined(NO_CRYPTO) && !defined(CRYPTO)
|
||||
#define CRYPTO
|
||||
#else
|
||||
|
Loading…
x
Reference in New Issue
Block a user