Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
Z
ZLMediaKit
概览
Overview
Details
Activity
Cycle Analytics
版本库
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
问题
0
Issues
0
列表
Board
标记
里程碑
合并请求
0
Merge Requests
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
Snippets
成员
Collapse sidebar
Close sidebar
活动
图像
聊天
创建新问题
作业
提交
Issue Boards
Open sidebar
张翔宇
ZLMediaKit
Commits
d619296f
Commit
d619296f
authored
May 11, 2017
by
xiongziliang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
精简
parent
a4233bde
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
17 行增加
和
74 行删除
+17
-74
CMakeLists.txt
+12
-34
cmake/FindFAAC.cmake
+1
-1
tests/CMakeLists.txt
+4
-39
没有找到文件。
CMakeLists.txt
查看文件 @
d619296f
...
...
@@ -21,13 +21,15 @@ foreach(SUB_DIR ${SUB_DIR_LIST})
execute_process
(
COMMAND cp
${
HEADER_FILES
}
${
PROJECT_BINARY_DIR
}
/include/
${
CMAKE_PROJECT_NAME
}
/
${
SUB_DIR
}
/
)
endforeach
(
SUB_DIR
${
SUB_DIR_LIST
}
)
set
(
LINK_LIB_LIST
)
#查找openssl是否安装
find_package
(
O
PEN
SSL QUIET
)
find_package
(
O
pen
SSL QUIET
)
if
(
OPENSSL_FOUND
)
message
(
STATUS
"找到openssl库:
\"
${
OPENSSL_INCLUDE_DIR
}
\"
,ENABLE_OPENSSL宏已打开"
)
include_directories
(
${
OPENSSL_INCLUDE_DIR
}
)
add_definitions
(
-DENABLE_OPENSSL
)
list
(
APPEND LINK_LIB_LIST
${
OPENSSL_LIBRARIES
}
)
endif
(
OPENSSL_FOUND
)
#查找mysql是否安装
...
...
@@ -36,6 +38,7 @@ if(MYSQL_FOUND)
message
(
STATUS
"找到mysqlclient库:
\"
${
MYSQL_INCLUDE_DIR
}
\"
,ENABLE_MYSQL宏已打开"
)
include_directories
(
${
MYSQL_INCLUDE_DIR
}
)
add_definitions
(
-DENABLE_MYSQL
)
list
(
APPEND LINK_LIB_LIST
${
MYSQL_LIBRARIES
}
)
endif
(
MYSQL_FOUND
)
...
...
@@ -45,14 +48,16 @@ if(MP4V2_FOUND)
message
(
STATUS
"找到mp4v2库:
\"
${
MP4V2_INCLUDE_DIR
}
\"
,ENABLE_MP4V2宏已打开"
)
include_directories
(
${
MP4V2_INCLUDE_DIR
}
)
add_definitions
(
-DENABLE_MP4V2
)
list
(
APPEND LINK_LIB_LIST
${
MP4V2_LIBRARIES
}
)
endif
(
MP4V2_FOUND
)
#查找x264是否安装
find_package
(
X264 QUIET
)
if
(
X264_FOUND
)
message
(
STATUS
"找到x264库:
\"
${
X264_INCLUDE_DIR
S
}
\"
,ENABLE_X264宏已打开"
)
message
(
STATUS
"找到x264库:
\"
${
X264_INCLUDE_DIR
}
\"
,ENABLE_X264宏已打开"
)
include_directories
(
${
X264_INCLUDE_DIRS
}
)
add_definitions
(
-DENABLE_X264
)
list
(
APPEND LINK_LIB_LIST
${
X264_LIBRARIES
}
)
endif
(
X264_FOUND
)
#查找faac是否安装
...
...
@@ -61,6 +66,7 @@ if(FAAC_FOUND)
message
(
STATUS
"找到faac库:
\"
${
FAAC_INCLUDE_DIR
}
\"
,ENABLE_FAAC宏已打开"
)
include_directories
(
${
FAAC_INCLUDE_DIR
}
)
add_definitions
(
-DENABLE_FAAC
)
list
(
APPEND LINK_LIB_LIST
${
FAAC_LIBRARIES
}
)
endif
(
FAAC_FOUND
)
#查找ZLToolKit是否安装
...
...
@@ -68,9 +74,11 @@ find_package(ZLTOOLKIT QUIET)
if
(
ZLTOOLKIT_FOUND
)
message
(
STATUS
"找到ZLToolKit库:
\"
${
ZLTOOLKIT_INCLUDE_DIR
}
\"
"
)
include_directories
(
${
ZLTOOLKIT_INCLUDE_DIR
}
/ZLToolKit
)
list
(
APPEND LINK_LIB_LIST
${
ZLTOOLKIT_LIBRARIES
}
)
endif
(
ZLTOOLKIT_FOUND
)
#打印库文件
message
(
STATUS
"将链接依赖库:
${
LINK_LIB_LIST
}
"
)
#开启RTSP/RTMP之间的互相转换,开启HLS
add_definitions
(
-DENABLE_RTMP2RTSP -DENABLE_RTSP2RTMP -DENABLE_HLS
)
...
...
@@ -90,37 +98,7 @@ if(NOT IOS)
add_library
(
${
CMAKE_PROJECT_NAME
}
_shared SHARED
${
SRC_LIST
}
)
set_target_properties
(
${
CMAKE_PROJECT_NAME
}
_shared PROPERTIES OUTPUT_NAME
"
${
CMAKE_PROJECT_NAME
}
"
)
install
(
TARGETS
${
CMAKE_PROJECT_NAME
}
_shared LIBRARY DESTINATION lib
)
#查找mp4v2是否安装
if
(
MP4V2_FOUND
)
target_link_libraries
(
${
CMAKE_PROJECT_NAME
}
_shared
${
MP4V2_LIBRARY
}
)
endif
(
MP4V2_FOUND
)
#查找x264是否安装
if
(
X264_FOUND
)
target_link_libraries
(
${
CMAKE_PROJECT_NAME
}
_shared
${
X264_LIBRARIES
}
)
endif
(
X264_FOUND
)
#查找faac是否安装
if
(
FAAC_FOUND
)
target_link_libraries
(
${
CMAKE_PROJECT_NAME
}
_shared
${
FAAC_LIBRARY
}
)
endif
(
FAAC_FOUND
)
#查找ZLToolKit是否安装
if
(
ZLTOOLKIT_FOUND
)
target_link_libraries
(
${
CMAKE_PROJECT_NAME
}
_shared
${
ZLTOOLKIT_LIBRARY
}
)
endif
(
ZLTOOLKIT_FOUND
)
#查找openssl是否安装
if
(
OPENSSL_FOUND
)
target_link_libraries
(
${
CMAKE_PROJECT_NAME
}
_shared
${
OPENSSL_LIBRARYS
}
)
endif
(
OPENSSL_FOUND
)
#查找mysql是否安装
if
(
MYSQL_FOUND
)
target_link_libraries
(
${
CMAKE_PROJECT_NAME
}
_shared
${
MYSQL_LIBRARYS
}
)
endif
(
MYSQL_FOUND
)
target_link_libraries
(
${
CMAKE_PROJECT_NAME
}
_shared
${
LINK_LIB_LIST
}
)
endif
(
NOT IOS
)
#编译静态库
...
...
cmake/FindFAAC.cmake
查看文件 @
d619296f
...
...
@@ -9,7 +9,7 @@ find_library(FAAC_LIBRARY
)
set
(
FAAC_INCLUDE_DIRS
${
FAAC_INCLUDE_DIR
}
)
set
(
MP4V2
_LIBRARIES
${
FAAC_LIBRARY
}
)
set
(
FAAC
_LIBRARIES
${
FAAC_LIBRARY
}
)
include
(
FindPackageHandleStandardArgs
)
...
...
tests/CMakeLists.txt
查看文件 @
d619296f
...
...
@@ -2,6 +2,7 @@
find_package
(
SDL QUIET
)
if
(
SDL_FOUND
)
include_directories
(
${
SDL_INCLUDE_DIR
}
)
list
(
APPEND LINK_LIB_LIST
${
SDL_LIBRARY
}
)
message
(
STATUS
"找到SDL"
)
endif
(
SDL_FOUND
)
...
...
@@ -9,6 +10,7 @@ endif(SDL_FOUND)
find_package
(
AVUTIL QUIET
)
if
(
AVUTIL_FOUND
)
include_directories
(
${
AVUTIL_INCLUDE_DIR
}
)
list
(
APPEND LINK_LIB_LIST
${
AVUTIL_LIBRARIES
}
)
message
(
STATUS
"找到libutil"
)
endif
(
AVUTIL_FOUND
)
...
...
@@ -16,12 +18,11 @@ endif(AVUTIL_FOUND)
find_package
(
AVCODEC QUIET
)
if
(
AVCODEC_FOUND
)
include_directories
(
${
AVCODEC_INCLUDE_DIR
}
)
list
(
APPEND LINK_LIB_LIST
${
AVCODEC_LIBRARIES
}
)
message
(
STATUS
"找到libavcodec"
)
endif
(
AVCODEC_FOUND
)
aux_source_directory
(
. TEST_SRC_LIST
)
#如果ffmpeg/libavcodec ffmpeg/libavcodec SDL 都安装了则编译 test_player
if
(
SDL_FOUND AND AVCODEC_FOUND AND AVUTIL_FOUND
)
message
(
STATUS
"test_player被编译"
)
...
...
@@ -35,43 +36,7 @@ STRING(REGEX REPLACE ".cpp" "" TEST_EXE_NAME ${TEST_SRC})
STRING
(
REGEX REPLACE
"./"
""
TEST_EXE_NAME
${
TEST_EXE_NAME
}
)
message
(
STATUS
"add test program:
${
TEST_EXE_NAME
}
"
)
add_executable
(
${
TEST_EXE_NAME
}
${
TEST_SRC
}
)
target_link_libraries
(
${
TEST_EXE_NAME
}
${
CMAKE_PROJECT_NAME
}
_shared pthread
)
#查找mp4v2是否安装
if
(
MP4V2_FOUND
)
target_link_libraries
(
${
TEST_EXE_NAME
}
${
MP4V2_LIBRARY
}
)
endif
(
MP4V2_FOUND
)
#查找x264是否安装
if
(
X264_FOUND
)
target_link_libraries
(
${
TEST_EXE_NAME
}
${
X264_LIBRARIES
}
)
endif
(
X264_FOUND
)
#查找faac是否安装
if
(
FAAC_FOUND
)
target_link_libraries
(
${
TEST_EXE_NAME
}
${
FAAC_LIBRARY
}
)
endif
(
FAAC_FOUND
)
#查找ZLToolKit是否安装
if
(
ZLTOOLKIT_FOUND
)
target_link_libraries
(
${
TEST_EXE_NAME
}
${
ZLTOOLKIT_LIBRARY
}
)
endif
(
ZLTOOLKIT_FOUND
)
#查找openssl是否安装
if
(
OPENSSL_FOUND
)
target_link_libraries
(
${
TEST_EXE_NAME
}
${
OPENSSL_LIBRARYS
}
)
endif
(
OPENSSL_FOUND
)
#查找mysql是否安装
if
(
MYSQL_FOUND
)
target_link_libraries
(
${
TEST_EXE_NAME
}
${
MYSQL_LIBRARYS
}
)
endif
(
MYSQL_FOUND
)
#link test_player
if
(
TEST_EXE_NAME STREQUAL test_player
)
target_link_libraries
(
${
TEST_EXE_NAME
}
${
SDL_LIBRARY
}
${
AVCODEC_LIBRARIES
}
${
AVUTIL_LIBRARIES
}
)
endif
(
TEST_EXE_NAME STREQUAL test_player
)
target_link_libraries
(
${
TEST_EXE_NAME
}
${
CMAKE_PROJECT_NAME
}
_shared
${
LINK_LIB_LIST
}
pthread
)
endforeach
(
TEST_SRC
${
TEST_SRC_LIST
}
)
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论