-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
365 lines (329 loc) · 18.3 KB
/
Copy pathCMakeLists.txt
File metadata and controls
365 lines (329 loc) · 18.3 KB
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
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
cmake_minimum_required(VERSION 3.19)
project(HyprCapture VERSION "0.2.8")
set(CMAKE_CXX_STANDARD 23)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_AUTOMOC ON)
include(CTest)
include(GNUInstallDirs)
set(HYPRCAPTURE_DEFAULT_HELPER_PATH "" CACHE FILEPATH "Optional trusted default path to hyprcapture-ui")
set(HYPRCAPTURE_TRUSTED_BIN_DIRS "" CACHE STRING "Colon-separated extra trusted program directories")
add_compile_definitions(WLR_USE_UNSTABLE)
if(HYPRCAPTURE_DEFAULT_HELPER_PATH)
add_compile_definitions(HYPRCAPTURE_DEFAULT_HELPER_PATH="${HYPRCAPTURE_DEFAULT_HELPER_PATH}")
endif()
if(HYPRCAPTURE_TRUSTED_BIN_DIRS)
add_compile_definitions(HYPRCAPTURE_TRUSTED_BIN_DIRS="${HYPRCAPTURE_TRUSTED_BIN_DIRS}")
endif()
add_compile_options(
-g
-Wall
-Wextra
-Wno-unused-parameter
-Wno-unused-value
-Wno-missing-field-initializers
-Wno-narrowing
-Wno-pointer-arith
--no-gnu-unique
)
find_package(PkgConfig REQUIRED)
pkg_check_modules(HYPR_DEPS REQUIRED hyprland)
pkg_check_modules(GIO REQUIRED gio-2.0 gio-unix-2.0)
pkg_check_modules(LUA REQUIRED lua)
pkg_check_modules(PULSE REQUIRED IMPORTED_TARGET libpulse)
pkg_check_modules(PIPEWIRE REQUIRED IMPORTED_TARGET libpipewire-0.3)
pkg_check_modules(FFMPEG_MUX REQUIRED IMPORTED_TARGET libavformat libavcodec libavutil)
find_package(Qt6 REQUIRED COMPONENTS Core Gui Widgets Svg DBus Network)
find_package(LayerShellQt REQUIRED)
find_package(nlohmann_json REQUIRED)
set(HYPRLAND_SOURCE_DIR "" CACHE PATH "Optional Hyprland source checkout to use for plugin headers")
set(HYPRLAND_INCLUDE_DIRS ${HYPR_DEPS_INCLUDE_DIRS})
if(HYPRLAND_SOURCE_DIR)
if(NOT EXISTS "${HYPRLAND_SOURCE_DIR}/src/plugins/PluginAPI.hpp")
message(FATAL_ERROR "HYPRLAND_SOURCE_DIR must point at a Hyprland checkout")
endif()
set(HYPRLAND_LOCAL_HEADER_ROOT "${CMAKE_CURRENT_BINARY_DIR}/hyprland-local-headers")
file(MAKE_DIRECTORY "${HYPRLAND_LOCAL_HEADER_ROOT}/hyprland")
file(REMOVE "${HYPRLAND_LOCAL_HEADER_ROOT}/hyprland/src")
file(REMOVE "${HYPRLAND_LOCAL_HEADER_ROOT}/hyprland/protocols")
execute_process(COMMAND "${CMAKE_COMMAND}" -E create_symlink "${HYPRLAND_SOURCE_DIR}/src" "${HYPRLAND_LOCAL_HEADER_ROOT}/hyprland/src")
execute_process(COMMAND "${CMAKE_COMMAND}" -E create_symlink "${HYPRLAND_SOURCE_DIR}/protocols" "${HYPRLAND_LOCAL_HEADER_ROOT}/hyprland/protocols")
list(PREPEND HYPRLAND_INCLUDE_DIRS "${HYPRLAND_LOCAL_HEADER_ROOT}")
endif()
set(HYPRLAND_DERIVED_INCLUDE_DIRS)
foreach(HYPRLAND_INCLUDE_DIR IN LISTS HYPRLAND_INCLUDE_DIRS)
list(APPEND HYPRLAND_DERIVED_INCLUDE_DIRS "${HYPRLAND_INCLUDE_DIR}")
if(EXISTS "${HYPRLAND_INCLUDE_DIR}/hyprland")
list(APPEND HYPRLAND_DERIVED_INCLUDE_DIRS "${HYPRLAND_INCLUDE_DIR}/hyprland")
endif()
if(EXISTS "${HYPRLAND_INCLUDE_DIR}/hyprland/src")
list(APPEND HYPRLAND_DERIVED_INCLUDE_DIRS "${HYPRLAND_INCLUDE_DIR}/hyprland/src")
endif()
if(EXISTS "${HYPRLAND_INCLUDE_DIR}/hyprland/protocols")
list(APPEND HYPRLAND_DERIVED_INCLUDE_DIRS "${HYPRLAND_INCLUDE_DIR}/hyprland/protocols")
endif()
endforeach()
list(REMOVE_DUPLICATES HYPRLAND_DERIVED_INCLUDE_DIRS)
add_library(hyprcapture SHARED
src/plugin/audio_session.cpp
src/plugin/main.cpp
src/plugin/notification.cpp
src/plugin/artifact_capture.cpp
src/plugin/window_stream.cpp
src/plugin/window_stream_control.cpp
src/plugin/window_stream_sender.cpp
src/plugin/window_gpu_wire.cpp
src/plugin/window_gpu_sender.cpp
src/plugin/window_gpu_export.cpp
src/plugin/recording.cpp
src/plugin/timestamped_rgba.cpp
src/plugin/recording_state.cpp
src/plugin/session_launcher.cpp
src/plugin/timing.cpp
src/shared/config.cpp
src/shared/process_environment.cpp
src/shared/supervised_process.cpp
src/shared/protocol.cpp
src/shared/rgba_transform.cpp
src/shared/trusted_path.cpp
)
target_include_directories(hyprcapture BEFORE PRIVATE src ${HYPRLAND_DERIVED_INCLUDE_DIRS} ${LUA_INCLUDE_DIRS})
target_link_directories(hyprcapture PRIVATE ${HYPR_DEPS_LIBRARY_DIRS} ${LUA_LIBRARY_DIRS})
target_link_libraries(hyprcapture PRIVATE ${HYPR_DEPS_LIBRARIES} ${LUA_LIBRARIES} nlohmann_json::nlohmann_json)
target_link_libraries(hyprcapture PRIVATE PkgConfig::FFMPEG_MUX)
target_link_options(hyprcapture PRIVATE -Wl,-z,relro -Wl,-z,now -Wl,-z,noexecstack)
add_executable(hyprcapture-ui
src/audio/helper.cpp
src/audio/echo_source.cpp
src/audio/aec_policy.cpp
src/ui/main.cpp
src/ui/clipboard_utils.cpp
src/ui/capture_overlay.cpp
src/ui/remembered_settings.cpp
src/ui/overlay_paint.cpp
src/ui/result_thumbnail.cpp
src/ui/screenshot_notification.cpp
src/ui/watermark.cpp
src/shared/config.cpp
src/shared/process_environment.cpp
src/shared/protocol.cpp
src/shared/trusted_path.cpp
)
target_include_directories(hyprcapture-ui PRIVATE src)
target_include_directories(hyprcapture-ui PRIVATE ${GIO_INCLUDE_DIRS})
target_link_directories(hyprcapture-ui PRIVATE ${GIO_LIBRARY_DIRS})
target_link_libraries(hyprcapture-ui PRIVATE Qt6::Network Qt6::Core Qt6::Gui Qt6::Widgets Qt6::Svg Qt6::DBus LayerShellQt::Interface nlohmann_json::nlohmann_json)
target_link_libraries(hyprcapture-ui PRIVATE ${GIO_LIBRARIES} PkgConfig::PULSE PkgConfig::PIPEWIRE)
target_link_options(hyprcapture-ui PRIVATE -Wl,-z,relro -Wl,-z,now -Wl,-z,noexecstack)
# Optional inference stays outside the compositor and UI. No TensorFlow headers
# are needed here; the pinned CPU runtime is loaded through its stable C ABI.
pkg_check_modules(FFTW REQUIRED IMPORTED_TARGET fftw3)
pkg_check_modules(SWRESAMPLE REQUIRED IMPORTED_TARGET libswresample libavutil)
add_library(hyprcapture-dtln STATIC src/audio/dtln.cpp src/audio/dtln_stream.cpp)
set_target_properties(hyprcapture-dtln PROPERTIES POSITION_INDEPENDENT_CODE ON)
target_include_directories(hyprcapture-dtln PUBLIC src)
target_link_libraries(hyprcapture-dtln PUBLIC PkgConfig::FFTW PkgConfig::SWRESAMPLE ${CMAKE_DL_LIBS})
add_library(spa-aec-dtln SHARED src/audio/dtln_spa.cpp)
target_link_libraries(spa-aec-dtln PRIVATE hyprcapture-dtln PkgConfig::PIPEWIRE)
add_executable(hyprcapture-aec src/audio/aec_worker.cpp src/audio/aec_policy.cpp)
pkg_get_variable(HYPRCAPTURE_SPA_PLUGIN_DIR libspa-0.2 plugindir)
target_compile_definitions(hyprcapture-aec PRIVATE HYPRCAPTURE_SPA_PLUGIN_DIR="${HYPRCAPTURE_SPA_PLUGIN_DIR}")
target_link_libraries(hyprcapture-aec PRIVATE hyprcapture-dtln Qt6::Core Qt6::Network PkgConfig::PIPEWIRE)
qt_add_resources(hyprcapture-aec "aec-golden" PREFIX "/aec" BASE "resources/aec"
FILES resources/aec/golden-256.qz resources/aec/golden-512.qz)
find_package(OpenVINO QUIET COMPONENTS Runtime)
if(OpenVINO_FOUND)
add_library(hyprcapture-aec-openvino SHARED src/audio/dtln_openvino.cpp)
target_include_directories(hyprcapture-aec-openvino PRIVATE src)
target_link_libraries(hyprcapture-aec-openvino PRIVATE openvino::runtime)
install(TARGETS hyprcapture-aec-openvino LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}/hyprcapture)
endif()
set(HYPRCAPTURE_AEC_MODEL_DIR "" CACHE PATH "Immutable installed DTLN model directory (e.g. Nix store)")
set(HYPRCAPTURE_TFLITE_LIBRARY "" CACHE FILEPATH "Installed TensorFlow Lite 2.14.0 C runtime")
foreach(aec_target hyprcapture-ui hyprcapture-aec)
if(HYPRCAPTURE_AEC_MODEL_DIR)
target_compile_definitions(${aec_target} PRIVATE HYPRCAPTURE_AEC_MODEL_DIR="${HYPRCAPTURE_AEC_MODEL_DIR}")
endif()
if(HYPRCAPTURE_TFLITE_LIBRARY)
target_compile_definitions(${aec_target} PRIVATE HYPRCAPTURE_TFLITE_LIBRARY="${HYPRCAPTURE_TFLITE_LIBRARY}")
endif()
endforeach()
install(TARGETS hyprcapture-aec RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
install(TARGETS spa-aec-dtln LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}/hyprcapture)
install(PROGRAMS scripts/build-aec-runtime.sh DESTINATION ${CMAKE_INSTALL_BINDIR} RENAME hyprcapture-build-aec-runtime)
install(PROGRAMS scripts/install-aec.sh DESTINATION ${CMAKE_INSTALL_BINDIR} RENAME hyprcapture-install-aec)
install(FILES resources/aec/DTLN-LICENSE.txt DESTINATION ${CMAKE_INSTALL_DATADIR}/licenses/hyprcapture)
if(BUILD_TESTING)
add_library(hyprcapture-fake-tflite SHARED tests/aec_fake_tflite.cpp)
add_executable(hyprcapture-aec-spa-test tests/aec_spa_test.cpp)
target_link_libraries(hyprcapture-aec-spa-test PRIVATE PkgConfig::PIPEWIRE ${CMAKE_DL_LIBS})
add_test(NAME aec-overload COMMAND hyprcapture-aec-spa-test $<TARGET_FILE:spa-aec-dtln> $<TARGET_FILE:hyprcapture-fake-tflite>)
set_tests_properties(aec-overload PROPERTIES TIMEOUT 10)
add_executable(hyprcapture-aec-delay-test tests/aec_delay_test.cpp)
target_link_libraries(hyprcapture-aec-delay-test PRIVATE hyprcapture-dtln)
add_test(NAME aec-delay COMMAND hyprcapture-aec-delay-test)
add_executable(hyprcapture-aec-policy-test tests/aec_policy_test.cpp src/audio/aec_policy.cpp src/ui/remembered_settings.cpp src/shared/config.cpp)
target_include_directories(hyprcapture-aec-policy-test PRIVATE src)
target_link_libraries(hyprcapture-aec-policy-test PRIVATE Qt6::Core)
add_test(NAME aec-policy COMMAND hyprcapture-aec-policy-test)
find_package(Qt6 REQUIRED COMPONENTS Test)
get_target_property(HYPRCAPTURE_UI_TEST_SOURCES hyprcapture-ui SOURCES)
list(REMOVE_ITEM HYPRCAPTURE_UI_TEST_SOURCES src/ui/main.cpp)
add_executable(hyprcapture-sound-ui-test tests/sound_ui_test.cpp ${HYPRCAPTURE_UI_TEST_SOURCES})
# Isolate UI tests from an installed AEC worker and network/model downloads.
set_target_properties(hyprcapture-sound-ui-test PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/test-ui")
target_include_directories(hyprcapture-sound-ui-test PRIVATE src ${GIO_INCLUDE_DIRS})
target_link_libraries(hyprcapture-sound-ui-test PRIVATE Qt6::Test Qt6::Widgets Qt6::Svg Qt6::DBus LayerShellQt::Interface nlohmann_json::nlohmann_json ${GIO_LIBRARIES} PkgConfig::PULSE PkgConfig::PIPEWIRE)
add_test(NAME hyprcapture-sound-ui-test COMMAND hyprcapture-sound-ui-test)
set_tests_properties(hyprcapture-sound-ui-test PROPERTIES ENVIRONMENT "QT_QPA_PLATFORM=offscreen" TIMEOUT 20)
add_executable(hyprcapture-audio-timeline-test tests/audio_timeline_test.cpp)
target_include_directories(hyprcapture-audio-timeline-test PRIVATE src)
target_compile_options(hyprcapture-audio-timeline-test PRIVATE -UNDEBUG)
add_test(NAME hyprcapture-audio-timeline-test COMMAND hyprcapture-audio-timeline-test)
find_package(Python3 COMPONENTS Interpreter)
if(Python3_Interpreter_FOUND)
add_test(NAME hyprcapture-audio-finalize-test COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/tests/audio_finalize_test.py $<TARGET_FILE:hyprcapture-ui>)
set_tests_properties(hyprcapture-audio-finalize-test PROPERTIES TIMEOUT 90 SKIP_RETURN_CODE 77)
endif()
add_executable(hyprcapture-supervised-process-test
tests/supervised_process_test.cpp
src/shared/supervised_process.cpp
)
target_include_directories(hyprcapture-supervised-process-test PRIVATE src)
add_test(NAME hyprcapture-supervised-process-test COMMAND hyprcapture-supervised-process-test)
set_tests_properties(hyprcapture-supervised-process-test PROPERTIES TIMEOUT 10)
add_executable(hyprcapture-config-test
tests/config_test.cpp
src/shared/config.cpp
src/shared/protocol.cpp
)
target_include_directories(hyprcapture-config-test PRIVATE src)
target_link_libraries(hyprcapture-config-test PRIVATE nlohmann_json::nlohmann_json)
add_test(NAME hyprcapture-config-test COMMAND hyprcapture-config-test)
add_executable(hyprcapture-watermark-test
tests/watermark_test.cpp
src/ui/watermark.cpp
src/shared/config.cpp
)
target_include_directories(hyprcapture-watermark-test PRIVATE src)
target_link_libraries(hyprcapture-watermark-test PRIVATE Qt6::Gui Qt6::Svg)
add_test(NAME hyprcapture-watermark-test COMMAND hyprcapture-watermark-test)
add_executable(hyprcapture-security-test
tests/security_test.cpp
src/ui/clipboard_utils.cpp
src/shared/process_environment.cpp
src/shared/trusted_path.cpp
)
target_include_directories(hyprcapture-security-test PRIVATE src)
target_link_libraries(hyprcapture-security-test PRIVATE Qt6::Core Qt6::Gui)
add_test(NAME hyprcapture-security-test COMMAND hyprcapture-security-test)
add_executable(hyprcapture-process-environment-test
tests/process_environment_test.cpp
src/shared/process_environment.cpp
)
target_include_directories(hyprcapture-process-environment-test PRIVATE src)
add_test(NAME hyprcapture-process-environment-test COMMAND hyprcapture-process-environment-test)
add_executable(hyprcapture-overlay-paint-test
tests/overlay_paint_test.cpp
src/ui/overlay_paint.cpp
)
target_include_directories(hyprcapture-overlay-paint-test PRIVATE src)
target_link_libraries(hyprcapture-overlay-paint-test PRIVATE Qt6::Gui)
add_test(NAME hyprcapture-overlay-paint-test COMMAND hyprcapture-overlay-paint-test)
add_executable(hyprcapture-recording-state-test
tests/recording_state_test.cpp
src/plugin/recording_state.cpp
)
target_include_directories(hyprcapture-recording-state-test PRIVATE src)
target_link_libraries(hyprcapture-recording-state-test PRIVATE nlohmann_json::nlohmann_json)
add_test(NAME hyprcapture-recording-state-test COMMAND hyprcapture-recording-state-test)
add_executable(hyprcapture-recording-codec-test tests/recording_codec_test.cpp)
target_include_directories(hyprcapture-recording-codec-test PRIVATE src)
target_compile_options(hyprcapture-recording-codec-test PRIVATE -UNDEBUG)
add_test(NAME hyprcapture-recording-codec-test COMMAND hyprcapture-recording-codec-test)
add_executable(hyprcapture-timestamped-rgba-fixture tests/timestamped_rgba_fixture.cpp src/plugin/timestamped_rgba.cpp)
target_include_directories(hyprcapture-timestamped-rgba-fixture PRIVATE src)
target_link_libraries(hyprcapture-timestamped-rgba-fixture PRIVATE PkgConfig::FFMPEG_MUX)
if(Python3_Interpreter_FOUND)
add_test(NAME hyprcapture-recording-timestamps-test COMMAND ${Python3_EXECUTABLE}
${CMAKE_CURRENT_SOURCE_DIR}/tests/recording_timestamps_test.py
$<TARGET_FILE:hyprcapture-timestamped-rgba-fixture> $<TARGET_FILE:hyprcapture-ui>)
set_tests_properties(hyprcapture-recording-timestamps-test PROPERTIES TIMEOUT 90 SKIP_RETURN_CODE 77)
endif()
add_executable(hyprcapture-rgba-transform-test
tests/rgba_transform_test.cpp
src/shared/rgba_transform.cpp
)
target_include_directories(hyprcapture-rgba-transform-test PRIVATE src)
add_test(NAME hyprcapture-rgba-transform-test COMMAND hyprcapture-rgba-transform-test)
add_executable(hyprcapture-trusted-path-test
tests/trusted_path_test.cpp
src/shared/trusted_path.cpp
)
target_include_directories(hyprcapture-trusted-path-test PRIVATE src)
add_test(NAME hyprcapture-trusted-path-test COMMAND hyprcapture-trusted-path-test)
add_executable(hyprcapture-window-stream-test
tests/window_stream_test.cpp
src/plugin/window_stream.cpp
)
target_include_directories(hyprcapture-window-stream-test PRIVATE src)
target_compile_options(hyprcapture-window-stream-test PRIVATE -UNDEBUG)
add_test(NAME hyprcapture-window-stream-test COMMAND hyprcapture-window-stream-test)
add_executable(hyprcapture-window-stream-sender-test
tests/window_stream_sender_test.cpp
src/plugin/window_stream.cpp
src/plugin/window_stream_sender.cpp
)
target_include_directories(hyprcapture-window-stream-sender-test PRIVATE src)
target_compile_options(hyprcapture-window-stream-sender-test PRIVATE -UNDEBUG)
add_test(NAME hyprcapture-window-stream-sender-test COMMAND hyprcapture-window-stream-sender-test)
add_executable(hyprcapture-window-gpu-wire-test
tests/window_gpu_wire_test.cpp
src/plugin/window_gpu_wire.cpp
)
target_include_directories(hyprcapture-window-gpu-wire-test PRIVATE src)
target_compile_options(hyprcapture-window-gpu-wire-test PRIVATE -UNDEBUG)
add_test(NAME hyprcapture-window-gpu-wire-test COMMAND hyprcapture-window-gpu-wire-test)
add_executable(hyprcapture-window-gpu-sender-test
tests/window_gpu_sender_test.cpp
src/plugin/window_gpu_wire.cpp
src/plugin/window_gpu_sender.cpp
)
target_include_directories(hyprcapture-window-gpu-sender-test PRIVATE src)
target_compile_options(hyprcapture-window-gpu-sender-test PRIVATE -UNDEBUG)
target_link_libraries(hyprcapture-window-gpu-sender-test PRIVATE Threads::Threads)
add_test(NAME hyprcapture-window-gpu-sender-test COMMAND hyprcapture-window-gpu-sender-test)
set_tests_properties(hyprcapture-window-gpu-sender-test PROPERTIES TIMEOUT 10)
option(HYPRCAPTURE_GPU_EXPORT_TEST "Build hardware-dependent EGL DMA-BUF export test" OFF)
if(HYPRCAPTURE_GPU_EXPORT_TEST)
pkg_check_modules(GPU_EXPORT_EGL REQUIRED IMPORTED_TARGET egl glesv2)
add_executable(hyprcapture-window-gpu-export-test
tests/window_gpu_export_test.cpp
src/plugin/window_gpu_export.cpp
src/plugin/window_gpu_wire.cpp
src/plugin/window_gpu_sender.cpp
)
target_include_directories(hyprcapture-window-gpu-export-test PRIVATE src)
target_compile_options(hyprcapture-window-gpu-export-test PRIVATE -UNDEBUG)
target_link_libraries(hyprcapture-window-gpu-export-test PRIVATE PkgConfig::GPU_EXPORT_EGL Threads::Threads)
add_test(NAME hyprcapture-window-gpu-export-test COMMAND hyprcapture-window-gpu-export-test)
set_tests_properties(hyprcapture-window-gpu-export-test PROPERTIES TIMEOUT 15)
endif()
add_executable(hyprcapture-window-stream-control-test
tests/window_stream_control_test.cpp
src/plugin/window_stream_control.cpp
)
target_include_directories(hyprcapture-window-stream-control-test PRIVATE src)
target_compile_options(hyprcapture-window-stream-control-test PRIVATE -UNDEBUG)
target_link_libraries(hyprcapture-window-stream-control-test PRIVATE nlohmann_json::nlohmann_json)
add_test(NAME hyprcapture-window-stream-control-test COMMAND hyprcapture-window-stream-control-test)
add_executable(hyprcapture-window-stream-extent-test tests/window_stream_extent_test.cpp)
target_include_directories(hyprcapture-window-stream-extent-test PRIVATE src)
target_compile_options(hyprcapture-window-stream-extent-test PRIVATE -UNDEBUG)
add_test(NAME hyprcapture-window-stream-extent-test COMMAND hyprcapture-window-stream-extent-test)
add_executable(hyprcapture-window-stream-cadence-test tests/window_stream_cadence_test.cpp)
target_include_directories(hyprcapture-window-stream-cadence-test PRIVATE src)
target_compile_options(hyprcapture-window-stream-cadence-test PRIVATE -UNDEBUG)
add_test(NAME hyprcapture-window-stream-cadence-test COMMAND hyprcapture-window-stream-cadence-test)
endif()
install(TARGETS hyprcapture LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})
install(TARGETS hyprcapture-ui RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})