mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2024-11-22 10:40:05 +08:00
调整cmake
This commit is contained in:
parent
9c552128a7
commit
b5bf930467
@ -225,10 +225,23 @@ if(ENABLE_API)
|
|||||||
add_subdirectory(api)
|
add_subdirectory(api)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(ENABLE_WEBRTC)
|
if (ENABLE_WEBRTC)
|
||||||
add_definitions(-DENABLE_WEBRTC)
|
#查找srtp是否安装
|
||||||
add_subdirectory(webrtc)
|
find_package(SRTP QUIET)
|
||||||
endif()
|
if (SRTP_FOUND)
|
||||||
|
message(STATUS "found library:${SRTP_LIBRARIES}")
|
||||||
|
include_directories(${SRTP_INCLUDE_DIRS})
|
||||||
|
list(APPEND LINK_LIB_LIST ${SRTP_LIBRARIES})
|
||||||
|
|
||||||
|
add_definitions(-DENABLE_WEBRTC)
|
||||||
|
include_directories(./webrtc)
|
||||||
|
file(GLOB SRC_WEBRTC_LIST ./webrtc/*.cpp ./webrtc/*.h ./webrtc/*.hpp)
|
||||||
|
add_library(webrtc ${SRC_WEBRTC_LIST})
|
||||||
|
list(APPEND LINK_LIB_LIST webrtc)
|
||||||
|
else ()
|
||||||
|
message(WARNING "srtp未找到, webrtc相关功能打开失败")
|
||||||
|
endif ()
|
||||||
|
endif ()
|
||||||
|
|
||||||
if (NOT IOS)
|
if (NOT IOS)
|
||||||
#测试程序
|
#测试程序
|
||||||
|
@ -32,7 +32,7 @@ set(_SRTP_ROOT_PATHS
|
|||||||
|
|
||||||
find_path(SRTP_INCLUDE_DIRS
|
find_path(SRTP_INCLUDE_DIRS
|
||||||
NAMES srtp2/srtp.h
|
NAMES srtp2/srtp.h
|
||||||
HINTS _SRTP_ROOT_PATHS
|
HINTS _SRTP_ROOT_PATHS ${SRTP_PREFIX}
|
||||||
PATH_SUFFIXES include
|
PATH_SUFFIXES include
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -42,7 +42,7 @@ endif()
|
|||||||
|
|
||||||
find_library(SRTP_LIBRARIES
|
find_library(SRTP_LIBRARIES
|
||||||
NAMES srtp2
|
NAMES srtp2
|
||||||
HINTS ${_SRTP_ROOT_PATHS}
|
HINTS ${_SRTP_ROOT_PATHS} ${SRTP_PREFIX}
|
||||||
PATH_SUFFIXES bin lib
|
PATH_SUFFIXES bin lib
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -1,16 +0,0 @@
|
|||||||
list(APPEND LINK_LIB_LIST webrtc)
|
|
||||||
#查找srtp是否安装
|
|
||||||
find_package(SRTP QUIET)
|
|
||||||
if (SRTP_FOUND)
|
|
||||||
message(STATUS "found library:${SRTP_LIBRARIES}")
|
|
||||||
include_directories(${SRTP_INCLUDE_DIRS})
|
|
||||||
list(APPEND LINK_LIB_LIST ${SRTP_LIBRARIES})
|
|
||||||
else ()
|
|
||||||
message(FATAL_ERROR "srtp未找到!")
|
|
||||||
endif ()
|
|
||||||
|
|
||||||
include_directories(./)
|
|
||||||
file(GLOB SRC_LIST ./*.cpp ./*.h ./*.hpp)
|
|
||||||
add_library(webrtc ${SRC_LIST})
|
|
||||||
set(LINK_LIB_LIST ${LINK_LIB_LIST} PARENT_SCOPE)
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user