obs-aitum-multistream/CMakeLists.txt

73 lines
2.1 KiB
CMake
Raw Normal View History

2024-06-13 11:58:07 +02:00
# --- Detect if the plugin is build out of tree or not ---
if(CMAKE_PROJECT_NAME STREQUAL "obs-studio")
set(BUILD_OUT_OF_TREE OFF)
2024-06-13 17:17:25 +02:00
set(OBS_FRONTEND_API_NAME "obs-frontend-api")
2024-06-13 11:58:07 +02:00
else()
set(BUILD_OUT_OF_TREE ON)
2024-06-13 17:17:25 +02:00
set(OBS_FRONTEND_API_NAME "frontend-api")
cmake_minimum_required(VERSION 3.16...3.26)
2024-06-13 11:58:07 +02:00
endif()
2024-06-13 17:17:25 +02:00
include("${CMAKE_CURRENT_SOURCE_DIR}/cmake/common/bootstrap.cmake" NO_POLICY_SCOPE)
2024-06-13 11:58:07 +02:00
2024-06-13 17:17:25 +02:00
project(${_name} VERSION ${_version})
2024-06-13 11:58:07 +02:00
2024-06-13 17:17:25 +02:00
include(compilerconfig)
include(defaults)
include(helpers)
2024-06-13 11:58:07 +02:00
add_library(${PROJECT_NAME} MODULE)
2024-06-13 17:17:25 +02:00
target_link_libraries(${PROJECT_NAME} PRIVATE OBS::libobs)
2024-06-13 11:58:07 +02:00
if(BUILD_OUT_OF_TREE)
find_package(libobs REQUIRED)
2024-06-13 11:58:07 +02:00
find_package(obs-frontend-api REQUIRED)
2024-06-13 17:17:25 +02:00
target_link_libraries(${PROJECT_NAME} PRIVATE OBS::obs-frontend-api)
2024-06-13 11:58:07 +02:00
else()
2024-06-13 17:17:25 +02:00
target_link_libraries(${PROJECT_NAME} PRIVATE OBS::frontend-api)
2024-06-13 11:58:07 +02:00
endif()
2024-06-13 17:17:25 +02:00
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>)
2024-07-31 07:54:52 +02:00
set_target_properties(${PROJECT_NAME} PROPERTIES MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
2024-06-13 17:17:25 +02:00
set_target_properties(
${PROJECT_NAME}
PROPERTIES AUTOMOC ON
AUTOUIC ON
AUTORCC ON)
if(BUILD_OUT_OF_TREE)
find_package(CURL REQUIRED)
2024-06-13 11:58:07 +02:00
endif()
2024-06-13 17:17:25 +02:00
target_link_libraries(${PROJECT_NAME} PRIVATE CURL::libcurl)
2024-06-13 11:58:07 +02:00
2024-06-13 17:17:25 +02:00
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/version.h.in ${CMAKE_CURRENT_SOURCE_DIR}/version.h)
2024-06-13 11:58:07 +02:00
2024-06-13 17:17:25 +02:00
target_sources(${PROJECT_NAME} PRIVATE
config-dialog.cpp
2024-07-26 15:18:09 +02:00
config-utils.cpp
output-dialog.cpp
2024-07-31 22:58:25 +02:00
stream-key-input.cpp
2024-06-13 17:17:25 +02:00
multistream.cpp
file-updater.c
resources.qrc
config-dialog.hpp
2024-07-26 15:18:09 +02:00
config-utils.hpp
output-dialog.hpp
2024-07-31 22:58:25 +02:00
stream-key-input.hpp
2024-06-13 17:17:25 +02:00
multistream.hpp
file-updater.h)
2024-06-13 11:58:07 +02:00
if(BUILD_OUT_OF_TREE)
2024-06-13 17:17:25 +02:00
set_target_properties_plugin(${CMAKE_PROJECT_NAME} PROPERTIES OUTPUT_NAME ${_name})
2024-06-13 11:58:07 +02:00
else()
2024-06-13 17:17:25 +02:00
set_target_properties_obs(${PROJECT_NAME} PROPERTIES FOLDER "plugins/aitum" PREFIX "")
2024-06-13 11:58:07 +02:00
endif()