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

47 lines
1.2 KiB
CMake
Raw Permalink Normal View History

2016-02-23 23:16:51 +00:00
project(obs-x264)
find_package(Libx264 REQUIRED)
include_directories(${LIBX264_INCLUDE_DIRS})
add_definitions(${LIBX264_DEFINITIONS})
2020-10-01 20:15:25 +00:00
set(obs-x264-util_HEADERS
obs-x264-options.h)
set(obs-x264-util_SOURCES
obs-x264-options.c)
add_library(obs-x264-util STATIC
${obs-x264-util_HEADERS}
${obs-x264-util_SOURCES})
target_link_libraries(obs-x264-util PRIVATE libobs)
set_target_properties(obs-x264-util PROPERTIES
FOLDER "plugins"
POSITION_INDEPENDENT_CODE ON)
2016-02-23 23:16:51 +00:00
set(obs-x264_SOURCES
obs-x264.c
obs-x264-plugin-main.c)
2020-05-27 20:57:19 +00:00
if(WIN32)
set(MODULE_DESCRIPTION "OBS x264 encoder")
configure_file(${CMAKE_SOURCE_DIR}/cmake/winrc/obs-module.rc.in obs-x264.rc)
list(APPEND obs-x264_SOURCES
obs-x264.rc)
endif()
2016-02-23 23:16:51 +00:00
add_library(obs-x264 MODULE
2020-10-01 20:15:25 +00:00
${obs-x264_HEADERS}
2016-02-23 23:16:51 +00:00
${obs-x264_SOURCES})
target_link_libraries(obs-x264
libobs
2020-10-01 20:15:25 +00:00
obs-x264-util
2016-02-23 23:16:51 +00:00
${LIBX264_LIBRARIES})
2020-10-01 20:15:25 +00:00
set_target_properties(obs-x264 PROPERTIES FOLDER "plugins")
2016-02-23 23:16:51 +00:00
install_obs_plugin_with_data(obs-x264 data)
2020-10-01 20:15:25 +00:00
add_executable(obs-x264-test obs-x264-test.c)
set_target_properties(obs-x264-test PROPERTIES FOLDER "plugins")
target_link_libraries(obs-x264-test PRIVATE libobs obs-x264-util)
add_test(NAME obs-x264-test COMMAND obs-x264-test)