-
-
Notifications
You must be signed in to change notification settings - Fork 22
/
Copy pathCMakeLists.txt
94 lines (82 loc) · 2.49 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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
# --- 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)
if(OS_LINUX OR OS_FREEBSD OR OS_OPENBSD)
find_package(Qt6 REQUIRED Gui)
endif()
else()
find_package(Qt6 REQUIRED COMPONENTS Core Widgets)
endif()
target_link_libraries(${PROJECT_NAME} PRIVATE Qt::Core Qt::Widgets)
if(OS_LINUX OR OS_FREEBSD OR OS_OPENBSD)
target_link_libraries(${PROJECT_NAME} PRIVATE Qt::GuiPrivate)
endif()
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
vertical-canvas.cpp
scenes-dock.cpp
sources-dock.cpp
source-tree.cpp
transitions-dock.cpp
qt-display.cpp
projector.cpp
config-dialog.cpp
hotkey-edit.cpp
name-dialog.cpp
audio-wrapper-source.c
file-updater.c
multi-canvas-source.c
resources.qrc
vertical-canvas.hpp
scenes-dock.hpp
sources-dock.hpp
source-tree.hpp
transitions-dock.hpp
qt-display.hpp
projector.hpp
display-helpers.hpp
config-dialog.hpp
hotkey-edit.hpp
name-dialog.hpp
audio-wrapper-source.h
obs-websocket-api.h
file-updater.h
multi-canvas-source.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()