obs-studio/plugins/aja/CMakeLists.txt
Paul Hindt 182410cf6c aja: Prepare plugins for new libajantv2 repo
Support building AJA plugins with either the new libajantv2 library, or
the deprecated ntv2 library.

Finder scripts updated to search for libajantv2 and fall back to ntv2 if
not found. This allows this PR to be merged without requiring a
corresponding update to the pre-built obs-deps packages.
2024-05-02 14:31:16 -04:00

72 lines
1.9 KiB
CMake

cmake_minimum_required(VERSION 3.22...3.25)
legacy_check()
option(ENABLE_AJA "Build OBS with aja support" ON)
if(NOT ENABLE_AJA)
set_property(GLOBAL APPEND PROPERTY OBS_MODULES_DISABLED aja)
return()
endif()
find_package(LibAJANTV2 REQUIRED)
add_library(aja MODULE)
add_library(OBS::aja ALIAS aja)
add_library(aja-support OBJECT)
add_library(OBS::aja-support ALIAS aja-support)
target_sources(
aja-support
PRIVATE # cmake-format: sortable
aja-card-manager.cpp
aja-common.cpp
aja-presets.cpp
aja-props.cpp
aja-routing.cpp
aja-vpid-data.cpp
aja-widget-io.cpp
PUBLIC # cmake-format: sortable
aja-card-manager.hpp
aja-common.hpp
aja-enums.hpp
aja-presets.hpp
aja-props.hpp
aja-routing.hpp
aja-ui-props.hpp
aja-vpid-data.hpp
aja-widget-io.hpp)
target_link_libraries(aja-support PUBLIC OBS::libobs AJA::LibAJANTV2)
set_target_properties(aja-support PROPERTIES FOLDER plugins/aja POSITION_INDEPENDENT_CODE TRUE)
target_sources(
aja
PRIVATE # cmake-format: sortable
aja-output.cpp
aja-output.hpp
aja-source.cpp
aja-source.hpp
audio-repack.c
audio-repack.h
audio-repack.hpp
main.cpp)
target_compile_options(
aja-support PUBLIC $<$<COMPILE_LANG_AND_ID:CXX,AppleClang,Clang,GNU>:-Wno-deprecated-declarations>
$<$<PLATFORM_ID:Linux,FreeBSD,OpenBSD>:-Wno-unused-variable>)
target_link_libraries(aja PRIVATE OBS::aja-support)
if(OS_WINDOWS)
configure_file(cmake/windows/obs-module.rc.in win-aja.rc)
target_sources(aja PRIVATE win-aja.rc)
set_property(TARGET aja PROPERTY COMPILE_WARNING_AS_ERROR FALSE)
endif()
# cmake-format: off
set_target_properties_obs(aja PROPERTIES FOLDER plugins/aja PREFIX "")
# cmake-format: on