当用pkg-config找avcodec与avutil时,应该就AVCODEC_INCLUDE_DIRS,AVUTIL_INCLUDE_DIRS

当用pkg-config找avcodec与avutil时,应该就AVCODEC_INCLUDE_DIRS,AVUTIL_INCLUDE_DIRS而不是AVCODEC_INCLUDE_DIR,AVUTIL_INCLUDE_DIR
This commit is contained in:
doodoocoder 2020-09-10 13:35:35 +08:00 committed by GitHub
parent 9c96f8d31a
commit 2ae9d7c2ef
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -14,7 +14,7 @@ find_package(PkgConfig QUIET)
if(PKG_CONFIG_FOUND) if(PKG_CONFIG_FOUND)
pkg_check_modules(AVUTIL QUIET IMPORTED_TARGET libavutil) pkg_check_modules(AVUTIL QUIET IMPORTED_TARGET libavutil)
if(AVUTIL_FOUND) if(AVUTIL_FOUND)
include_directories(${AVUTIL_INCLUDE_DIR}) include_directories(${AVUTIL_INCLUDE_DIRS})
link_directories(${AVUTIL_LIBRARY_DIRS}) link_directories(${AVUTIL_LIBRARY_DIRS})
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}")
@ -32,7 +32,7 @@ endif()
if(PKG_CONFIG_FOUND) if(PKG_CONFIG_FOUND)
pkg_check_modules(AVCODEC QUIET IMPORTED_TARGET libavcodec) pkg_check_modules(AVCODEC QUIET IMPORTED_TARGET libavcodec)
if(AVCODEC_FOUND) if(AVCODEC_FOUND)
include_directories(${AVCODEC_INCLUDE_DIR}) include_directories(${AVCODEC_INCLUDE_DIRS})
link_directories(${AVCODEC_LIBRARY_DIRS}) link_directories(${AVCODEC_LIBRARY_DIRS})
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}")