-
Notifications
You must be signed in to change notification settings - Fork 8
/
CMakeLists.txt
70 lines (60 loc) · 2 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
# --- Detect if the plugin is build out of tree or not ---
if(CMAKE_PROJECT_NAME STREQUAL "obs-studio")
set(BUILD_OUT_OF_TREE OFF)
else()
set(BUILD_OUT_OF_TREE ON)
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)
target_link_libraries(${PROJECT_NAME} PRIVATE OBS::libobs)
if(BUILD_OUT_OF_TREE)
find_package(libobs REQUIRED)
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 MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
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
config-utils.cpp
output-dialog.cpp
stream-key-input.cpp
multistream.cpp
file-updater.c
resources.qrc
config-dialog.hpp
config-utils.hpp
output-dialog.hpp
stream-key-input.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()