Fixed FFMPEG libs and set all libs non-static

This commit is contained in:
Evgeny Shulgin 2017-02-21 19:31:12 +03:00
parent 4ee9c847da
commit 00ead85ab7
2 changed files with 26 additions and 7 deletions

View File

@ -72,9 +72,13 @@ if (PKG_CONFIG_FOUND AND WITH_FFMPEG)
pkg_check_modules (AVUTIL REQUIRED libavutil)
pkg_check_modules (AVCODEC REQUIRED libavcodec)
set (EXTRA_LIBS ${EXTRA_LIBS} ${AVFORMAT_STATIC_LIBRARIES})
set (EXTRA_LIBS ${EXTRA_LIBS} ${AVUTIL_STATIC_LIBRARIES})
set (EXTRA_LIBS ${EXTRA_LIBS} ${AVCODEC_STATIC_LIBRARIES})
set (EXTRA_LIBS ${EXTRA_LIBS} ${AVFORMAT_LIBRARIES})
set (EXTRA_LIBS ${EXTRA_LIBS} ${AVUTIL_LIBRARIES})
set (EXTRA_LIBS ${EXTRA_LIBS} ${AVCODEC_LIBRARIES})
set (EXTRA_INCLUDES ${EXTRA_INCLUDES} ${AVFORMAT_INCLUDE_DIRS})
set (EXTRA_INCLUDES ${EXTRA_INCLUDES} ${AVUTIL_INCLUDE_DIRS})
set (EXTRA_INCLUDES ${EXTRA_INCLUDES} ${AVCODEC_INCLUDE_DIRS})
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DENABLE_FFMPEG")
endif (PKG_CONFIG_FOUND AND WITH_FFMPEG)
@ -89,8 +93,8 @@ if (WITH_OCR)
pkg_check_modules (TESSERACT REQUIRED tesseract)
pkg_check_modules (LEPTONICA REQUIRED lept)
set (EXTRA_LIBS ${EXTRA_LIBS} ${TESSERACT_STATIC_LIBRARIES})
set (EXTRA_LIBS ${EXTRA_LIBS} ${LEPTONICA_STATIC_LIBRARIES})
set (EXTRA_LIBS ${EXTRA_LIBS} ${TESSERACT_LIBRARIES})
set (EXTRA_LIBS ${EXTRA_LIBS} ${LEPTONICA_LIBRARIES})
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DENABLE_OCR")
endif (WITH_OCR)
@ -114,5 +118,6 @@ endif (WITH_SHARING)
add_executable (ccextractor ${SOURCEFILE})
target_link_libraries (ccextractor ${EXTRA_LIBS})
target_include_directories (ccextractor PUBLIC ${EXTRA_INCLUDES})
install (TARGETS ccextractor DESTINATION bin)

View File

@ -3,6 +3,20 @@ cmake_policy (SET CMP0037 NEW)
set (CMAKE_C_FLAGS "-O0 -Wall -g -std=gnu99")
if (WITH_FFMPEG)
find_package(PkgConfig)
pkg_check_modules (AVFORMAT REQUIRED libavformat)
pkg_check_modules (AVUTIL REQUIRED libavutil)
pkg_check_modules (AVCODEC REQUIRED libavcodec)
set (EXTRA_LIBS ${EXTRA_LIBS} ${AVFORMAT_LIBRARIES})
set (EXTRA_LIBS ${EXTRA_LIBS} ${AVUTIL_LIBRARIES})
set (EXTRA_LIBS ${EXTRA_LIBS} ${AVCODEC_LIBRARIES})
set (EXTRA_INCLUDES ${EXTRA_INCLUDES} ${AVFORMAT_INCLUDE_DIRS})
set (EXTRA_INCLUDES ${EXTRA_INCLUDES} ${AVUTIL_INCLUDE_DIRS})
set (EXTRA_INCLUDES ${EXTRA_INCLUDES} ${AVCODEC_INCLUDE_DIRS})
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DENABLE_FFMPEG")
endif (WITH_FFMPEG)
@ -15,8 +29,8 @@ if (WITH_OCR)
set (EXTRA_INCLUDES ${EXTRA_INCLUDES} ${TESSERACT_INCLUDE_DIRS})
set (EXTRA_INCLUDES ${EXTRA_INCLUDES} ${LEPTONICA_INCLUDE_DIRS})
set (EXTRA_LIBS ${EXTRA_LIBS} ${TESSERACT_STATIC_LIBRARIES})
set (EXTRA_LIBS ${EXTRA_LIBS} ${LEPTONICA_STATIC_LIBRARIES})
set (EXTRA_LIBS ${EXTRA_LIBS} ${TESSERACT_LIBRARIES})
set (EXTRA_LIBS ${EXTRA_LIBS} ${LEPTONICA_LIBRARIES})
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DENABLE_OCR")
endif (WITH_OCR)