Commit b5bf9304 by ziyue

调整cmake

parent 9c552128
......@@ -225,10 +225,23 @@ if(ENABLE_API)
add_subdirectory(api)
endif()
if(ENABLE_WEBRTC)
add_definitions(-DENABLE_WEBRTC)
add_subdirectory(webrtc)
endif()
if (ENABLE_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})
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)
#测试程序
......
......@@ -32,7 +32,7 @@ set(_SRTP_ROOT_PATHS
find_path(SRTP_INCLUDE_DIRS
NAMES srtp2/srtp.h
HINTS _SRTP_ROOT_PATHS
HINTS _SRTP_ROOT_PATHS ${SRTP_PREFIX}
PATH_SUFFIXES include
)
......@@ -42,7 +42,7 @@ endif()
find_library(SRTP_LIBRARIES
NAMES srtp2
HINTS ${_SRTP_ROOT_PATHS}
HINTS ${_SRTP_ROOT_PATHS} ${SRTP_PREFIX}
PATH_SUFFIXES bin lib
)
......
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)
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论