Files
obs-studio/UI/frontend-plugins/decklink-captions/CMakeLists.txt
T
PatTheMav 2809284795 UI: Add UI support interface library with custom Qt elements
Allows the customized UI elements used by OBS Studio to more cleanly
be integrated into consumers of the same elements, mainly frontend
plugins in the main source tree.
2023-12-19 17:59:44 -05:00

53 lines
1.5 KiB
CMake

cmake_minimum_required(VERSION 3.22...3.25)
legacy_check()
if(NOT ENABLE_DECKLINK)
target_disable(decklink-captions)
return()
endif()
if(OS_LINUX
OR OS_FREEBSD
OR OS_OPENBSD)
find_package(X11 REQUIRED)
mark_as_advanced(X11)
endif()
# cmake-format: off
find_package(Qt6 REQUIRED Widgets)
# cmake-format: on
add_library(decklink-captions MODULE)
add_library(OBS::decklink-captions ALIAS decklink-captions)
target_sources(decklink-captions PRIVATE decklink-captions.cpp decklink-captions.h forms/captions.ui)
target_compile_options(decklink-captions PRIVATE $<$<PLATFORM_ID:Darwin>:-Wno-quoted-include-in-framework-header>
$<$<PLATFORM_ID:Darwin>:-Wno-comma>)
target_link_libraries(
decklink-captions
PRIVATE OBS::frontend-api OBS::libobs Qt::Widgets
"$<$<PLATFORM_ID:Darwin>:$<LINK_LIBRARY:FRAMEWORK,Cocoa.framework>>" $<$<PLATFORM_ID:Linux,FreeBSD>:X11::X11>)
if(OS_WINDOWS)
configure_file(cmake/windows/obs-module.rc.in decklink-captions.rc)
target_sources(decklink-captions PRIVATE decklink-captions.rc)
# cmake-format: off
set_property(TARGET decklink-captions APPEND PROPERTY AUTORCC_OPTIONS --format-version 1)
# cmake-format: on
endif()
# cmake-format: off
set_target_properties_obs(
decklink-captions
PROPERTIES FOLDER plugins/decklink
PREFIX ""
AUTOMOC ON
AUTOUIC ON
AUTORCC ON
AUTOUIC_SEARCH_PATHS forms)
# cmake-format: on