obs-aitum-multistream/CMakeLists.txt
2024-06-13 17:43:54 +02:00

66 lines
1.9 KiB
CMake

# --- Detect if the plugin is build out of tree or not ---
if(CMAKE_PROJECT_NAME STREQUAL "obs-studio")
set(BUILD_OUT_OF_TREE OFF)
set(OBS_FRONTEND_API_NAME "obs-frontend-api")
else()
set(BUILD_OUT_OF_TREE ON)
set(OBS_FRONTEND_API_NAME "frontend-api")
cmake_minimum_required(VERSION 3.16...3.26)
endif()
include("${CMAKE_CURRENT_SOURCE_DIR}/cmake/common/bootstrap.cmake" NO_POLICY_SCOPE)
project(${_name} VERSION ${_version})
include(compilerconfig)
include(defaults)
include(helpers)
add_library(${PROJECT_NAME} MODULE)
find_package(libobs REQUIRED)
target_link_libraries(${PROJECT_NAME} PRIVATE OBS::libobs)
if(BUILD_OUT_OF_TREE)
find_package(obs-frontend-api REQUIRED)
target_link_libraries(${PROJECT_NAME} PRIVATE OBS::obs-frontend-api)
else()
target_link_libraries(${PROJECT_NAME} PRIVATE OBS::frontend-api)
endif()
if(BUILD_OUT_OF_TREE)
find_qt(COMPONENTS Widgets Core)
else()
find_package(Qt6 REQUIRED COMPONENTS Core Widgets)
endif()
target_link_libraries(${PROJECT_NAME} PRIVATE Qt::Core Qt::Widgets)
target_compile_options(
${PROJECT_NAME} PRIVATE $<$<C_COMPILER_ID:Clang,AppleClang>:-Wno-quoted-include-in-framework-header
-Wno-comma>)
set_target_properties(
${PROJECT_NAME}
PROPERTIES AUTOMOC ON
AUTOUIC ON
AUTORCC ON)
if(BUILD_OUT_OF_TREE)
find_package(CURL REQUIRED)
endif()
target_link_libraries(${PROJECT_NAME} PRIVATE CURL::libcurl)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/version.h.in ${CMAKE_CURRENT_SOURCE_DIR}/version.h)
target_sources(${PROJECT_NAME} PRIVATE
config-dialog.cpp
multistream.cpp
file-updater.c
resources.qrc
config-dialog.hpp
multistream.hpp
file-updater.h)
if(BUILD_OUT_OF_TREE)
set_target_properties_plugin(${CMAKE_PROJECT_NAME} PROPERTIES OUTPUT_NAME ${_name})
else()
set_target_properties_obs(${PROJECT_NAME} PROPERTIES FOLDER "plugins/aitum" PREFIX "")
endif()