mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2024-11-23 03:10:04 +08:00
优先使用 pkg-config 来查找 AV* 库
部分主机上 ffmpeg 安装路径不标准, 默认查找方式不方便适应该方式
This commit is contained in:
parent
97c2297d2a
commit
2fee173d7a
@ -8,21 +8,39 @@ if (SDL2_FOUND)
|
|||||||
message(STATUS "found library:${SDL2_LIBRARY}")
|
message(STATUS "found library:${SDL2_LIBRARY}")
|
||||||
endif (SDL2_FOUND)
|
endif (SDL2_FOUND)
|
||||||
|
|
||||||
|
find_package(PkgConfig QUIET)
|
||||||
|
|
||||||
#查找ffmpeg/libutil是否安装
|
#查找ffmpeg/libutil是否安装
|
||||||
|
if(PKG_CONFIG_FOUND)
|
||||||
|
pkg_check_modules(AVUTIL QUIET IMPORTED_TARGET libavutil)
|
||||||
|
if(AVUTIL_FOUND)
|
||||||
|
list(APPEND LINK_LIB_LIST PkgConfig::AVUTIL)
|
||||||
|
message(STATUS "found library:${AVUTIL_LIBRARY}")
|
||||||
|
endif()
|
||||||
|
else()
|
||||||
find_package(AVUTIL QUIET)
|
find_package(AVUTIL QUIET)
|
||||||
if(AVUTIL_FOUND)
|
if(AVUTIL_FOUND)
|
||||||
include_directories(${AVUTIL_INCLUDE_DIR})
|
include_directories(${AVUTIL_INCLUDE_DIR})
|
||||||
list(APPEND LINK_LIB_LIST ${AVUTIL_LIBRARIES})
|
list(APPEND LINK_LIB_LIST ${AVUTIL_LIBRARIES})
|
||||||
message(STATUS "found library:${AVUTIL_LIBRARIES}")
|
message(STATUS "found library:${AVUTIL_LIBRARIES}")
|
||||||
endif()
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
#查找ffmpeg/libavcodec是否安装
|
#查找ffmpeg/libavcodec是否安装
|
||||||
|
if(PKG_CONFIG_FOUND)
|
||||||
|
pkg_check_modules(AVCODEC QUIET IMPORTED_TARGET libavcodec)
|
||||||
|
if(AVCODEC_FOUND)
|
||||||
|
list(APPEND LINK_LIB_LIST PkgConfig::AVCODEC)
|
||||||
|
message(STATUS "found library:${AVCODEC_LIBRARY}")
|
||||||
|
endif()
|
||||||
|
else()
|
||||||
find_package(AVCODEC QUIET)
|
find_package(AVCODEC QUIET)
|
||||||
if(AVCODEC_FOUND)
|
if(AVCODEC_FOUND)
|
||||||
include_directories(${AVCODEC_INCLUDE_DIR})
|
include_directories(${AVCODEC_INCLUDE_DIR})
|
||||||
list(APPEND LINK_LIB_LIST ${AVCODEC_LIBRARIES})
|
list(APPEND LINK_LIB_LIST ${AVCODEC_LIBRARIES})
|
||||||
message(STATUS "found library:${AVCODEC_LIBRARIES}")
|
message(STATUS "found library:${AVCODEC_LIBRARIES}")
|
||||||
endif()
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
aux_source_directory(. TEST_SRC_LIST)
|
aux_source_directory(. TEST_SRC_LIST)
|
||||||
#如果ffmpeg/libavcodec ffmpeg/libavcodec SDL 都安装了则编译 test_player
|
#如果ffmpeg/libavcodec ffmpeg/libavcodec SDL 都安装了则编译 test_player
|
||||||
|
Loading…
Reference in New Issue
Block a user