safesight-edge/plugins/CMakeLists.txt

37 lines
1.5 KiB
CMake

set(RK_PLUGIN_OUTPUT_DIR ${CMAKE_BINARY_DIR}/plugins)
option(RK3588_ENABLE_FFMPEG "Enable FFmpeg-based RTSP input" OFF)
if(RK3588_ENABLE_FFMPEG)
find_package(PkgConfig REQUIRED)
pkg_check_modules(FFMPEG REQUIRED IMPORTED_TARGET libavformat libavcodec libavutil)
endif()
add_library(input_rtsp SHARED input_rtsp/input_rtsp_node.cpp)
target_include_directories(input_rtsp PRIVATE ${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/third_party)
target_link_libraries(input_rtsp PRIVATE project_options Threads::Threads)
if(RK3588_ENABLE_FFMPEG)
target_compile_definitions(input_rtsp PRIVATE RK3588_ENABLE_FFMPEG)
target_include_directories(input_rtsp PRIVATE ${FFMPEG_INCLUDE_DIRS})
target_link_libraries(input_rtsp PRIVATE PkgConfig::FFMPEG)
endif()
set_target_properties(input_rtsp PROPERTIES
OUTPUT_NAME "input_rtsp"
LIBRARY_OUTPUT_DIRECTORY ${RK_PLUGIN_OUTPUT_DIR}
RUNTIME_OUTPUT_DIRECTORY ${RK_PLUGIN_OUTPUT_DIR}
)
add_library(publish SHARED publish/publish_node.cpp)
target_include_directories(publish PRIVATE ${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/third_party)
target_link_libraries(publish PRIVATE project_options Threads::Threads)
set_target_properties(publish PROPERTIES
OUTPUT_NAME "publish"
LIBRARY_OUTPUT_DIRECTORY ${RK_PLUGIN_OUTPUT_DIR}
RUNTIME_OUTPUT_DIRECTORY ${RK_PLUGIN_OUTPUT_DIR}
)
install(TARGETS input_rtsp publish
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}/rk3588-media-server/plugins
RUNTIME DESTINATION ${CMAKE_INSTALL_LIBDIR}/rk3588-media-server/plugins
)