Linking dynamically with ffmpeg instead of compiling it

This commit is contained in:
Zoe Roux
2021-04-14 23:02:58 +02:00
parent 95f8e7d75b
commit 2fccd0d10e
3 changed files with 2 additions and 27 deletions

3
.gitmodules vendored
View File

@@ -1,3 +0,0 @@
[submodule "ffmpeg"]
path = ffmpeg
url = https://git.ffmpeg.org/ffmpeg.git

View File

@@ -4,9 +4,7 @@ set(CMAKE_C_STANDARD 11)
set(PROJECT_VERSION "1.0")
project(transcoder VERSION ${PROJECT_VERSION} LANGUAGES C)
include_directories(ffmpeg)
include_directories(include)
add_library(transcoder SHARED
src/helper.c
src/info.c
@@ -16,32 +14,13 @@ add_library(transcoder SHARED
src/destroyer.c
)
set_property(TARGET transcoder PROPERTY C_STANDARD 11)
set_property(TARGET transcoder PROPERTY POSITION_INDEPENDENT_CODE ON)
target_link_libraries(transcoder avformat avcodec avutil)
target_link_directories(transcoder PRIVATE
${CMAKE_SOURCE_DIR}/ffmpeg/libavformat
${CMAKE_SOURCE_DIR}/ffmpeg/libavcodec
${CMAKE_SOURCE_DIR}/ffmpeg/libavutil
)
target_link_libraries(transcoder m pthread)
if(WIN32)
target_link_libraries(transcoder wsock32 ws2_32)
target_link_libraries(transcoder Secur32 Secur32)
target_link_libraries(transcoder Bcrypt Bcrypt)
endif()
include(ExternalProject)
ExternalProject_Add(FFMPEG
SOURCE_DIR ${CMAKE_SOURCE_DIR}/ffmpeg
BUILD_IN_SOURCE 1
CONFIGURE_COMMAND ./configure --disable-shared --enable-static --enable-pic
--disable-debug --enable-gpl --enable-version3 --disable-asm
--disable-programs --disable-doc --disable-autodetect
--disable-avdevice --disable-swresample --disable-swscale --disable-postproc --disable-network
BUILD_COMMAND make
INSTALL_COMMAND cmake -E echo "Skipping install step."
)
add_dependencies(transcoder FFMPEG)
set_property(TARGET transcoder PROPERTY POSITION_INDEPENDENT_CODE ON)
endif()

1
ffmpeg

Submodule ffmpeg deleted from ed524136e0