cmake_minimum_required(VERSION 3.22...3.25) legacy_check() find_package(Qt6 REQUIRED Widgets) if(OS_LINUX OR OS_FREEBSD OR OS_OPENBSD) find_package(Qt6 REQUIRED Gui) find_package(X11 REQUIRED) endif() add_library(frontend-tools MODULE) add_library(OBS::frontend-tools ALIAS frontend-tools) target_sources( frontend-tools PRIVATE # cmake-format: sortable $<$:auto-scene-switcher-osx.mm> $<$:auto-scene-switcher-nix.cpp> $<$:auto-scene-switcher-win.cpp> $<$:captions-handler.cpp> $<$:captions-handler.hpp> $<$:captions-mssapi-stream.cpp> $<$:captions-mssapi-stream.hpp> $<$:captions-mssapi.cpp> $<$:captions-mssapi.hpp> $<$:captions.cpp> $<$:captions.hpp> auto-scene-switcher.cpp auto-scene-switcher.hpp frontend-tools.c output-timer.cpp output-timer.hpp tool-helpers.hpp) target_sources(frontend-tools PRIVATE forms/auto-scene-switcher.ui forms/captions.ui forms/output-timer.ui forms/scripts.ui) target_compile_options(frontend-tools PRIVATE $<$:-Wno-quoted-include-in-framework-header> $<$:-Wno-comma>) target_link_libraries( frontend-tools PRIVATE OBS::frontend-api OBS::libobs OBS::ui-support Qt::Widgets "$<$:$>" $<$:X11::X11> $<$:Qt::GuiPrivate>) add_subdirectory("${CMAKE_SOURCE_DIR}/deps/obs-scripting" "${CMAKE_BINARY_DIR}/deps/obs-scripting") if(ENABLE_SCRIPTING AND TARGET OBS::scripting) target_sources(frontend-tools PRIVATE scripts.cpp scripts.hpp) target_link_libraries(frontend-tools PRIVATE OBS::scripting) target_enable_feature(frontend-tools "Scripting Support (Frontend)" ENABLE_SCRIPTING) endif() if(OS_WINDOWS) configure_file(cmake/windows/obs-module.rc.in frontend-tools.rc) target_sources(frontend-tools PRIVATE frontend-tools.rc) # cmake-format: off set_property(TARGET frontend-tools APPEND PROPERTY AUTORCC_OPTIONS --format-version 1) # cmake-format: on endif() # cmake-format: off set_target_properties_obs( frontend-tools PROPERTIES FOLDER frontend PREFIX "" AUTOMOC ON AUTOUIC ON AUTORCC ON AUTOUIC_SEARCH_PATHS forms XCODE_ATTRIBUTE_CLANG_ENABLE_OBJC_ARC YES) # cmake-format: on