From 13dd8c699b113ba883db020bc6cd3f96baec43f0 Mon Sep 17 00:00:00 2001 From: ziyue <1213642868@qq.com> Date: Mon, 1 Aug 2022 16:12:52 +0800 Subject: [PATCH] =?UTF-8?q?=E6=95=B4=E7=90=86cmake?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CMakeLists.txt | 49 ++++++++++++++++++-------------- tests/default.pem => default.pem | 0 tests/CMakeLists.txt | 1 - 3 files changed, 28 insertions(+), 22 deletions(-) rename tests/default.pem => default.pem (100%) diff --git a/CMakeLists.txt b/CMakeLists.txt index e8cf5e03..42179823 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -344,7 +344,8 @@ if(OPENSSL_FOUND AND ENABLE_OPENSSL) endif() else() set(ENABLE_OPENSSL OFF) - message(WARNING "openssl 未找到, rtmp 将不支持 flash 播放器, https/wss/rtsps/rtmps 也将失效") + set(ENABLE_WEBRTC OFF) + message(WARNING "openssl 未找到, rtmp 将不支持 flash 播放器, https/wss/rtsps/rtmps/webrtc 也将失效") endif() # 查找 mysql 是否安装 @@ -428,24 +429,30 @@ if(ENABLE_API) endif() # IOS 不编译可执行程序 -if(NOT IOS) - if(ENABLE_PLAYER AND ENABLE_FFMPEG) - add_subdirectory(player) - endif() - - add_subdirectory(server) - # Android 会 add_subdirectory 并依赖该变量 - if(ENABLE_SERVER_LIB) - set(MK_LINK_LIBRARIES ${MK_LINK_LIBRARIES} PARENT_SCOPE) - endif() - - # 复制文件过来 - file(COPY "${CMAKE_CURRENT_SOURCE_DIR}/www" - DESTINATION ${EXECUTABLE_OUTPUT_PATH}) - file(COPY "${CMAKE_CURRENT_SOURCE_DIR}/conf/config.ini" - DESTINATION ${EXECUTABLE_OUTPUT_PATH}) - - if(ENABLE_TESTS) - add_subdirectory(tests) - endif() +if(IOS) + return() endif() + +############################################################################## + +if(ENABLE_PLAYER AND ENABLE_FFMPEG) + add_subdirectory(player) +endif() + +#MediaServer主程序 +add_subdirectory(server) + +# Android 会 add_subdirectory 并依赖该变量 +if(ENABLE_SERVER_LIB) + set(MK_LINK_LIBRARIES ${MK_LINK_LIBRARIES} PARENT_SCOPE) +endif() + +#cpp测试demo程序 +if (ENABLE_TESTS) + add_subdirectory(tests) +endif () + +# 拷贝www文件夹、配置文件、默认证书 +file(COPY "${CMAKE_CURRENT_SOURCE_DIR}/www" DESTINATION ${EXECUTABLE_OUTPUT_PATH}) +file(COPY "${CMAKE_CURRENT_SOURCE_DIR}/conf/config.ini" DESTINATION ${EXECUTABLE_OUTPUT_PATH}) +file(COPY "${CMAKE_CURRENT_SOURCE_DIR}/default.pem" DESTINATION ${EXECUTABLE_OUTPUT_PATH}) diff --git a/tests/default.pem b/default.pem similarity index 100% rename from tests/default.pem rename to default.pem diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 9d154764..43edf879 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -21,7 +21,6 @@ # SOFTWARE. # -execute_process(COMMAND cp ${CMAKE_CURRENT_SOURCE_DIR}/default.pem ${EXECUTABLE_OUTPUT_PATH}/) aux_source_directory(. TEST_SRC_LIST) foreach(TEST_SRC ${TEST_SRC_LIST})