yolobs-studio/plugins/obs-ffmpeg/CMakeLists.txt

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

73 lines
1.6 KiB
CMake
Raw Permalink Normal View History

2016-02-23 23:16:51 +00:00
project(obs-ffmpeg)
if(MSVC)
set(obs-ffmpeg_PLATFORM_DEPS
w32-pthreads)
endif()
2019-09-22 21:19:10 +00:00
option(ENABLE_FFMPEG_LOGGING "Enables obs-ffmpeg logging" OFF)
2016-02-23 23:16:51 +00:00
find_package(FFmpeg REQUIRED
COMPONENTS avcodec avfilter avdevice avutil swscale avformat swresample)
include_directories(${FFMPEG_INCLUDE_DIRS})
2019-09-22 21:19:10 +00:00
configure_file(
"${CMAKE_CURRENT_SOURCE_DIR}/obs-ffmpeg-config.h.in"
"${CMAKE_CURRENT_BINARY_DIR}/obs-ffmpeg-config.h")
include_directories(${CMAKE_CURRENT_BINARY_DIR})
set(obs-ffmpeg_config_HEADERS
"${CMAKE_CURRENT_BINARY_DIR}/obs-ffmpeg-config.h")
2016-02-23 23:16:51 +00:00
set(obs-ffmpeg_HEADERS
2020-12-22 17:32:50 +00:00
obs-ffmpeg-compat.h
2016-02-23 23:16:51 +00:00
obs-ffmpeg-formats.h
2020-12-22 17:32:50 +00:00
obs-ffmpeg-mux.h)
2019-07-27 12:47:10 +00:00
2016-02-23 23:16:51 +00:00
set(obs-ffmpeg_SOURCES
obs-ffmpeg.c
2018-02-19 19:54:37 +00:00
obs-ffmpeg-audio-encoders.c
2016-05-24 19:53:01 +00:00
obs-ffmpeg-nvenc.c
2016-02-23 23:16:51 +00:00
obs-ffmpeg-output.c
obs-ffmpeg-mux.c
2020-12-22 17:32:50 +00:00
obs-ffmpeg-hls-mux.c
2016-02-23 23:16:51 +00:00
obs-ffmpeg-source.c)
2019-07-27 12:47:10 +00:00
if(UNIX AND NOT APPLE)
list(APPEND obs-ffmpeg_SOURCES
obs-ffmpeg-vaapi.c)
LIST(APPEND obs-ffmpeg_PLATFORM_DEPS
${LIBVA_LBRARIES})
endif()
2019-09-22 21:19:10 +00:00
if(ENABLE_FFMPEG_LOGGING)
list(APPEND obs-ffmpeg_SOURCES
obs-ffmpeg-logging.c)
endif()
2019-07-27 12:47:10 +00:00
if(WIN32)
2020-05-27 20:57:19 +00:00
set(MODULE_DESCRIPTION "OBS FFmpeg module")
configure_file(${CMAKE_SOURCE_DIR}/cmake/winrc/obs-module.rc.in obs-ffmpeg.rc)
2019-07-27 12:47:10 +00:00
list(APPEND obs-ffmpeg_SOURCES
jim-nvenc.c
2020-05-27 20:57:19 +00:00
jim-nvenc-helpers.c
obs-ffmpeg.rc)
2019-07-27 12:47:10 +00:00
list(APPEND obs-ffmpeg_HEADERS
jim-nvenc.h)
endif()
2016-02-23 23:16:51 +00:00
add_library(obs-ffmpeg MODULE
2019-09-22 21:19:10 +00:00
${obs-ffmpeg_config_HEADERS}
2016-02-23 23:16:51 +00:00
${obs-ffmpeg_HEADERS}
${obs-ffmpeg_SOURCES})
target_link_libraries(obs-ffmpeg
libobs
2017-06-29 19:01:10 +00:00
media-playback
2016-02-23 23:16:51 +00:00
${obs-ffmpeg_PLATFORM_DEPS}
${FFMPEG_LIBRARIES})
2020-10-01 20:15:25 +00:00
set_target_properties(obs-ffmpeg PROPERTIES FOLDER "plugins/obs-ffmpeg")
2016-02-23 23:16:51 +00:00
install_obs_plugin_with_data(obs-ffmpeg data)
add_subdirectory(ffmpeg-mux)