cmake_minimum_required(VERSION 3.16...3.26) include("${CMAKE_CURRENT_SOURCE_DIR}/cmake/common/bootstrap.cmake" NO_POLICY_SCOPE) project(${_name} VERSION ${_version}) option(ENABLE_FRONTEND_API "Use obs-frontend-api for UI functionality" OFF) option(ENABLE_QT "Use Qt functionality" OFF) include(compilerconfig) include(defaults) include(helpers) add_library(${CMAKE_PROJECT_NAME} MODULE) find_package(libobs REQUIRED) target_link_libraries(${CMAKE_PROJECT_NAME} PRIVATE OBS::libobs) if(ENABLE_FRONTEND_API) find_package(obs-frontend-api REQUIRED) target_link_libraries(${CMAKE_PROJECT_NAME} PRIVATE OBS::obs-frontend-api) endif() if(ENABLE_QT) set(CMAKE_CONFIGURATION_TYPES "Release;RelWithDebInfo" CACHE STRING "" FORCE) set(CMAKE_INCLUDE_CURRENT_DIR ON) set(CMAKE_PREFIX_PATH $ENV{QTDIR}) find_package(Qt6Core REQUIRED) find_package(Qt6Widgets REQUIRED) find_package(Qt6WebEngineWidgets REQUIRED) find_package(Qt6WebView REQUIRED) qt_standard_project_setup() target_link_libraries(${CMAKE_PROJECT_NAME} PRIVATE Qt6::Core Qt6::Widgets Qt6::WebEngineWidgets Qt6::WebView) target_compile_options( ${CMAKE_PROJECT_NAME} PRIVATE $<$:-Wno-quoted-include-in-framework-header -Wno-comma>) set_target_properties( ${CMAKE_PROJECT_NAME} PROPERTIES AUTOMOC ON AUTOUIC ON AUTORCC ON) endif() target_sources(${CMAKE_PROJECT_NAME} PRIVATE src/plugin-main.cpp) set_target_properties_plugin(${CMAKE_PROJECT_NAME} PROPERTIES OUTPUT_NAME ${_name})