-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
CMakeLists.txt
113 lines (96 loc) · 3.19 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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
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)
string(TIMESTAMP TODAY "%Y.%m.%d %H:%M")
# Get the current working branch
execute_process(
COMMAND git rev-parse --abbrev-ref HEAD
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
OUTPUT_VARIABLE GIT_BRANCH
OUTPUT_STRIP_TRAILING_WHITESPACE)
# Get the latest commit hash
execute_process(
COMMAND git rev-parse --short HEAD
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
OUTPUT_VARIABLE GIT_COMMIT_HASH
OUTPUT_STRIP_TRAILING_WHITESPACE)
target_compile_definitions(${PROJECT_NAME} PUBLIC
GIT_BRANCH="${GIT_BRANCH}"
GIT_COMMIT_HASH="${GIT_COMMIT_HASH}"
PLUGIN_VERSION="${_version}"
BUILD_TIME="${TODAY}"
)
if(MSVC)
set(CMAKE_EXE_LINKER_FLAGS
"${CMAKE_EXE_LINKER_FLAGS} /NODEFAULTLIB")
endif()
find_package(libobs REQUIRED)
find_package(jansson REQUIRED)
target_link_libraries(${CMAKE_PROJECT_NAME} PRIVATE OBS::libobs jansson::jansson)
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)
find_package(Qt6 COMPONENTS Widgets Core)
target_link_libraries(${CMAKE_PROJECT_NAME} PRIVATE Qt6::Core Qt6::Widgets)
target_compile_options(
${CMAKE_PROJECT_NAME} PRIVATE $<$<C_COMPILER_ID:Clang,AppleClang>:-Wno-quoted-include-in-framework-header
-Wno-comma>)
set_target_properties(
${CMAKE_PROJECT_NAME}
PROPERTIES AUTOMOC ON
AUTOUIC ON
AUTORCC ON)
endif()
if (MSVC)
target_sources(${CMAKE_PROJECT_NAME} PRIVATE
./src/util/windows_helper.cpp
./src/util/windows_helper.hpp
)
endif()
target_sources(${CMAKE_PROJECT_NAME} PRIVATE
./src/durchblick_plugin.cpp
./src/layout.hpp
./src/layout.cpp
./src/config.cpp
./src/config.hpp
./src/util/util.h
./src/util/callbacks.h
./src/util/platform_util.hpp
./src/util/display_helpers.hpp
./src/util/volume_meter.cpp
./src/util/volume_meter.hpp
./src/util/mixer_renderer.cpp
./src/util/mixer_renderer.hpp
./src/ui/durchblick_dock.hpp
./src/ui/durchblick_dock.cpp
./src/ui/durchblick.hpp
./src/ui/durchblick.cpp
./src/ui/qt_display.hpp
./src/ui/qt_display.cpp
./src/ui/new_item_dialog.cpp
./src/ui/new_item_dialog.hpp
./src/ui/layout_config_dialog.cpp
./src/ui/layout_config_dialog.hpp
./src/items/registry.cpp
./src/items/registry.hpp
./src/items/item.hpp
./src/items/scene_item.cpp
./src/items/scene_item.hpp
./src/items/source_item.cpp
./src/items/source_item.hpp
./src/items/preview_program_item.cpp
./src/items/preview_program_item.hpp
./src/items/custom_item.cpp
./src/items/custom_item.hpp
./src/items/audio_mixer.cpp
./src/items/audio_mixer.hpp
)
set_target_properties_plugin(${CMAKE_PROJECT_NAME} PROPERTIES OUTPUT_NAME ${_name})