-
Notifications
You must be signed in to change notification settings - Fork 27
/
CMakeLists.txt
707 lines (612 loc) · 22.4 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
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
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
#####
##### This file is part of vimix - video live mixer
##### **Copyright** (C) 2019-2023 Bruno Herbelin <bruno.herbelin@gmail.com>
#####
cmake_minimum_required(VERSION 3.8.2)
project(vimix VERSION 0.0.1 LANGUAGES CXX C)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
#####
##### Use git to read version from tags
#####
find_package (Git)
if(GIT_EXECUTABLE)
execute_process(
COMMAND ${GIT_EXECUTABLE} describe --tags
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
OUTPUT_VARIABLE GIT_DESCRIBE_VERSION
RESULT_VARIABLE GIT_DESCRIBE_ERROR_CODE
OUTPUT_STRIP_TRAILING_WHITESPACE
)
if(NOT GIT_DESCRIBE_ERROR_CODE)
string(SUBSTRING ${GIT_DESCRIBE_VERSION} 0 1 VIMIX_VERSION_MAJOR)
string(SUBSTRING ${GIT_DESCRIBE_VERSION} 2 1 VIMIX_VERSION_MINOR)
string(LENGTH ${GIT_DESCRIBE_VERSION} VIMIX_VERSION_LENGTH)
if (VIMIX_VERSION_LENGTH GREATER 4)
string(SUBSTRING ${GIT_DESCRIBE_VERSION} 4 1 VIMIX_VERSION_PATCH)
else()
set(VIMIX_VERSION_PATCH "0")
endif()
add_definitions(-DVIMIX_GIT="${GIT_DESCRIBE_VERSION}")
add_definitions(-DVIMIX_VERSION_MAJOR=${VIMIX_VERSION_MAJOR})
add_definitions(-DVIMIX_VERSION_MINOR=${VIMIX_VERSION_MINOR})
add_definitions(-DVIMIX_VERSION_PATCH=${VIMIX_VERSION_PATCH})
message(STATUS "Compiling vimix version ${VIMIX_VERSION_MAJOR}.${VIMIX_VERSION_MINOR}.${VIMIX_VERSION_PATCH} (${GIT_DESCRIBE_VERSION})")
endif()
endif()
#####
##### Find the cmake modules
#####
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} /usr/share/cmake ${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules )
include(MacroLogFeature)
include(MacroFindGStreamerLibrary)
#####
##### Configure cmake
#####
set(BUILD_STATIC_LIBS ON)
set(CMAKE_INCLUDE_CURRENTDIR ON)
if(UNIX)
if (APPLE)
add_definitions(-DAPPLE)
# the RPATH to be used when installing
set(CMAKE_SKIP_RPATH TRUE)
set(OpenGL_DIR /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/)
# MacOS target
set(CMAKE_OSX_ARCHITECTURES "arm64" CACHE STRING "")
set(CMAKE_OSX_DEPLOYMENT_TARGET "13" CACHE STRING "")
# CPACK
set(CPACK_SYSTEM_NAME "OSX_${CMAKE_OSX_DEPLOYMENT_TARGET}_${CMAKE_OSX_ARCHITECTURES}")
set(CPACK_GENERATOR DragNDrop)
set(CPACK_BINARY_DRAGNDROP ON)
# Apple ID code signing
set(APPLE_CODESIGN_ENTITLEMENTS "${CMAKE_CURRENT_SOURCE_DIR}/osx/entitlements.plist")
## team ID, for example if your certificate is: Developer ID Application: JOHN, DOE (X4MF6H9XZ6) the team ID is: X4MF6H9XZ6
set(APPLE_CODESIGN_TEAM "" CACHE STRING "")
## Apple identity, in the form Developer ID Application
set(APPLE_CODESIGN_IDENTITY "Developer ID Application:" CACHE STRING "")
## Apple keychain profile for app-specific password
## 1. Create a password for "vimix" at https://support.apple.com/en-us/102654
## 2. Run e.g.
## xcrun notarytool store-credentials "vimix" --apple-id <email_login_apple_id> --team-id <team> --password <string_given_https://appleid.apple.com/account/manage>
set(APPLE_CODESIGN_STORED_CREDENTIAL "vimix" CACHE STRING "")
# find icu4c in OSX (pretty well hidden...)
set(ENV{PKG_CONFIG_PATH} "$ENV{PKG_CONFIG_PATH}:/usr/local/opt/icu4c/lib/pkgconfig:/opt/homebrew/opt/icu4c/lib/pkgconfig")
else()
add_definitions(-DLINUX)
# CPACK
set(CPACK_SYSTEM_NAME "${CMAKE_HOST_SYSTEM_NAME}")
# linux opengl
set(OpenGL_GL_PREFERENCE "GLVND")
# linux dialogs use GTK
find_package(GTK 3.0 REQUIRED)
macro_log_feature(GTK_FOUND "GTK" "GTK cross-platform widget toolkit" "http://www.gtk.org" TRUE)
find_package(X11 REQUIRED COMPONENTS xcb)
include_directories(
${X11_INCLUDE_DIR}
)
endif()
add_definitions(-DUNIX)
elseif(WIN32)
add_definitions(-DWIN32)
add_definitions(-DMINGW32)
endif()
#####
##### Preprocessor options
#####
# add_definitions(-DUSE_GST_OPENGL_SYNC_HANDLER)
# add_definitions(-DUSE_GL_BUFFER_SUBDATA)
# add_definitions(-DIGNORE_GST_BUS_MESSAGE)
#####
##### Dependencies
#####
#
# Basics
#
set(CMAKE_THREAD_PREFER_PTHREAD TRUE)
find_package(Threads REQUIRED)
find_package(ZLIB REQUIRED)
#
# GSTREAMER
#
find_package(GLIB2 REQUIRED)
macro_log_feature(GLIB2_FOUND "GLib" "GTK general-purpose utility library" "http://www.gtk.org" TRUE)
find_package(GObject REQUIRED)
macro_log_feature(GOBJECT_FOUND "GObject" "GTK object-oriented framework" "http://www.gtk.org" TRUE)
find_package(GStreamer 1.0.0 COMPONENTS base)
macro_log_feature(GSTREAMER_FOUND "GStreamer"
"Open Source Multiplatform Multimedia Framework"
"http://gstreamer.freedesktop.org/" TRUE "1.0.0")
find_package(GStreamerPluginsBase 1.0.0 COMPONENTS app audio video pbutils gl)
macro_log_feature(GSTREAMER_APP_LIBRARY_FOUND "GStreamerPluginsBase" "GStreamer app library"
"http://gstreamer.freedesktop.org/" TRUE "1.0.0")
macro_log_feature(GSTREAMER_AUDIO_LIBRARY_FOUND "GStreamerPluginsBase" "GStreamer audio library"
"http://gstreamer.freedesktop.org/" TRUE "1.0.0")
macro_log_feature(GSTREAMER_VIDEO_LIBRARY_FOUND "GStreamerPluginsBase" "GStreamer video library"
"http://gstreamer.freedesktop.org/" TRUE "1.0.0")
macro_log_feature(GSTREAMER_PBUTILS_LIBRARY_FOUND "GStreamerPluginsBase" "GStreamer pbutils library"
"http://gstreamer.freedesktop.org/" TRUE "1.0.0")
macro_log_feature(GSTREAMER_GL_LIBRARY_FOUND "GStreamerPluginsBase" "GStreamer opengl library"
"http://gstreamer.freedesktop.org/" TRUE "1.0.0")
# Various preprocessor definitions for GST
add_definitions(-DGST_DISABLE_XML -DGST_DISABLE_LOADSAVE)
include_directories(
${GLIB2_INCLUDE_DIR}
${GSTREAMER_INCLUDE_DIR}
${GSTREAMER_AUDIO_INCLUDE_DIR}
${GSTREAMER_VIDEO_INCLUDE_DIR}
${GSTREAMER_BASE_INCLUDE_DIR}
${GSTREAMER_APP_INCLUDE_DIR}
${GSTREAMER_PBUTILS_INCLUDE_DIR}
${GSTREAMER_GL_INCLUDE_DIR}
)
#
# ICU4C
#
if (PKG_CONFIG_FOUND)
pkg_check_modules(ICU REQUIRED icu-i18n icu-uc icu-io)
else ()
find_package(ICU REQUIRED COMPONENTS i18n io uc)
endif ()
macro_log_feature(ICU_FOUND "ICU" "International Components for Unicode" "http://site.icu-project.org" TRUE)
include_directories(
${ICU_INCLUDE_DIRS}
)
link_directories(
${ICU_LIBRARY_DIRS}
)
#
# GLFW3
#
if (PKG_CONFIG_FOUND)
pkg_check_modules(GLFW3 REQUIRED glfw3>=3.2)
else ()
find_package(glfw3 3.2 REQUIRED)
endif()
macro_log_feature(GLFW3_FOUND "glfw3" "Open Source multi-platform library for OpenGL" "http://www.glfw.org" TRUE)
include_directories(
${GLFW3_INCLUDE_DIRS}
)
link_directories(
${GLFW3_LIBRARY_DIRS}
)
#
# GLM
#
if (PKG_CONFIG_FOUND)
pkg_check_modules(GLM QUIET glm>=0.9.9)
else ()
find_package(glm 0.9.9 QUIET)
endif()
if (GLM_FOUND)
macro_log_feature(GLM_FOUND "GLM" "OpenGL mathematics" "https://glm.g-truc.net" TRUE)
else ()
set(GLM_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/ext/glm)
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/ext/glm)
message(STATUS "Compiling 'GLM' OpenGL mathematics https://glm.g-truc.net -- ${CMAKE_CURRENT_SOURCE_DIR}/ext/glm")
endif()
include_directories(
${GLM_INCLUDE_DIRS}
)
#
# TINY XML 2
#
if (PKG_CONFIG_FOUND)
pkg_check_modules(TINYXML2 QUIET tinyxml2>=8.0)
else ()
find_package(tinyxml2 8.0 QUIET)
endif()
if (TINYXML2_FOUND)
macro_log_feature(TINYXML2_FOUND "TinyXML2" "TinyXML2 library" "https://github.com/leethomason/tinyxml2.git" TRUE)
else ()
set(TINYXML2_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/ext/tinyxml2)
set(TINYXML2_LIBRARIES TINYXML2)
add_library(TINYXML2 "${CMAKE_CURRENT_SOURCE_DIR}/ext/tinyxml2/tinyxml2.cpp")
set_property(TARGET TINYXML2 PROPERTY CXX_STANDARD 17)
set_property(TARGET TINYXML2 PROPERTY C_STANDARD 11)
message(STATUS "Compiling 'TinyXML2' from https://github.com/leethomason/tinyxml2.git -- ${TINYXML2_INCLUDE_DIRS}")
endif()
include_directories(
${TINYXML2_INCLUDE_DIRS}
)
#
# STB
#
if (PKG_CONFIG_FOUND)
pkg_check_modules(STB QUIET stb)
else ()
find_package(stb QUIET)
endif()
if (STB_FOUND)
macro_log_feature(STB_FOUND "STB" "single-file image and audio processing" "https://github.com/nothings/stb" TRUE)
else ()
set(STB_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/ext/stb)
message(STATUS "Including 'STB' single-file image and audio processing from https://github.com/nothings/stb -- ${STB_INCLUDE_DIRS}")
endif()
include_directories(
${STB_INCLUDE_DIRS}
)
#
# Ableton LINK
#
find_package(AbletonLink QUIET)
if (AbletonLink_FOUND)
macro_log_feature(AbletonLink_FOUND "AbletonLink" "Ableton Link synchronizer" "https://github.com/Ableton/link" TRUE)
else ()
include(${CMAKE_CURRENT_SOURCE_DIR}/ext/link/AbletonLinkConfig.cmake)
message(STATUS "Compiling 'Ableton Link' from https://github.com/Ableton/link -- ${CMAKE_CURRENT_SOURCE_DIR}/ext/link")
endif()
include_directories(
${link_HEADERS}
)
#
# FILE DIALOG: use tinyfiledialog for all except Linux
#
if(APPLE OR WIN32)
set(TINYFD_LIBRARIES TINYFD)
set(TINYFD_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/ext/tfd)
include_directories(
${TINYFD_INCLUDE_DIR}
)
add_library(TINYFD "${CMAKE_CURRENT_SOURCE_DIR}/ext/tfd/tinyfiledialogs.c")
message(STATUS "Compiling 'TinyFileDialog' from https://git.code.sf.net/p/tinyfiledialogs/code -- ${TINYFD_INCLUDE_DIR}.")
endif()
#
# DIRENT (windows only)
if(WIN32)
set(DIRENT_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/ext/Dirent/include)
include_directories(
${DIRENT_INCLUDE_DIR}
)
message(STATUS "Including 'Dirent' from https://github.com/tronkko/dirent -- ${DIRENT_INCLUDE_DIR}.")
endif()
#
# SHMDATA (Unix only)
#
if(UNIX)
if (PKG_CONFIG_FOUND)
pkg_check_modules(SHMDATA QUIET shmdata-1.3)
endif()
if(SHMDATA_FOUND)
find_library(GSTREAMER_SHMDATA_LIBRARY
NAMES gstshmdata
HINTS ${SHMDATA_LIBRARY_DIRS}/gstreamer-1.0
)
if(GSTREAMER_SHMDATA_LIBRARY)
add_definitions(-DGSTREAMER_SHMDATA_PLUGIN=\"${GSTREAMER_SHMDATA_LIBRARY}\")
endif()
macro_log_feature(GSTREAMER_SHMDATA_LIBRARY "GStreamerPluginShmdata" "Plugin to share any flow" "https://gitlab.com/sat-mtl/tools/shmdata" FALSE)
endif(SHMDATA_FOUND)
endif(UNIX)
# show message about found libs
macro_display_feature_log()
#####
##### Locally built libraries
#####
#
# GLAD
#
set(GLAD_LIBRARIES GLAD)
set(GLAD_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/ext/glad/include)
include_directories(
${GLAD_INCLUDE_DIRS}
)
add_library(GLAD "${CMAKE_CURRENT_SOURCE_DIR}/ext/glad/src/glad.c")
set_property(TARGET GLAD PROPERTY C_STANDARD 11)
message(STATUS "Compiling 'GLAD 2' Open source multi-language OpenGL loader https://gen.glad.sh -- ${GLAD_INCLUDE_DIRS}")
#
# DEAR IMGUI
#
set(IMGUI_LIBRARIES IMGUI IMGUITEXTEDIT)
set(IMGUI_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/ext/imgui)
set(IMGUI_BACKEND_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/ext/imgui/examples)
include_directories(
${IMGUI_INCLUDE_DIRS}
${IMGUI_BACKEND_INCLUDE_DIRS}
)
set(IMGUI_SRCS
${CMAKE_CURRENT_SOURCE_DIR}/ext/imgui/imgui.cpp
${CMAKE_CURRENT_SOURCE_DIR}/ext/imgui//imgui_demo.cpp
${CMAKE_CURRENT_SOURCE_DIR}/ext/imgui//imgui_draw.cpp
${CMAKE_CURRENT_SOURCE_DIR}/ext/imgui//imgui_widgets.cpp
${CMAKE_CURRENT_SOURCE_DIR}/ext/imgui/examples/imgui_impl_glfw.cpp
${CMAKE_CURRENT_SOURCE_DIR}/ext/imgui/examples/imgui_impl_opengl3.cpp
)
add_library(IMGUI "${IMGUI_SRCS}")
target_compile_definitions(IMGUI PRIVATE "IMGUI_IMPL_OPENGL_LOADER_GLAD")
target_compile_definitions(IMGUI PRIVATE "IMGUI_USE_STB_SPRINTF")
message(STATUS "Compiling 'Dear ImGui' from https://github.com/ocornut/imgui.git -- ${IMGUI_INCLUDE_DIRS}")
#
# ImGui Color Text Editor
#
set(IMGUITEXTEDIT_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/ext/ImGuiColorTextEdit)
include_directories(
${IMGUITEXTEDIT_INCLUDE_DIR}
)
add_library(IMGUITEXTEDIT "${CMAKE_CURRENT_SOURCE_DIR}/ext/ImGuiColorTextEdit/TextEditor.cpp")
set_property(TARGET IMGUITEXTEDIT PROPERTY CXX_STANDARD 17)
message(STATUS "Compiling 'ImGuiColorTextEdit' from https://github.com/BalazsJako/ImGuiColorTextEdit -- ${IMGUITEXTEDIT_INCLUDE_DIR}")
#
# OSCPack
#
if(UNIX)
set(OSCPACK_PLATFORM_DIR ${CMAKE_CURRENT_SOURCE_DIR}/ext/OSCPack/ip/posix/)
elseif(WIN32)
set(OSCPACK_PLATFORM_DIR ${CMAKE_CURRENT_SOURCE_DIR}/ext/OSCPack/ip/win32/)
endif()
set(OSCPACK_SRCS
${CMAKE_CURRENT_SOURCE_DIR}/ext/OSCPack/osc/OscTypes.cpp
${CMAKE_CURRENT_SOURCE_DIR}/ext/OSCPack/osc/OscReceivedElements.cpp
${CMAKE_CURRENT_SOURCE_DIR}/ext/OSCPack/osc/OscPrintReceivedElements.cpp
${CMAKE_CURRENT_SOURCE_DIR}/ext/OSCPack/osc/OscOutboundPacketStream.cpp
${CMAKE_CURRENT_SOURCE_DIR}/ext/OSCPack/ip/IpEndpointName.cpp
${OSCPACK_PLATFORM_DIR}/NetworkingUtils.cpp
${OSCPACK_PLATFORM_DIR}/UdpSocket.cpp
)
set(OSCPACK_LIBRARIES OSCPACK)
set(OSCPACK_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/ext/OSCPack)
include_directories(
${OSCPACK_INCLUDE_DIR}
)
add_library(OSCPACK "${OSCPACK_SRCS}")
set_property(TARGET OSCPACK PROPERTY CXX_STANDARD 17)
set_property(TARGET OSCPACK PROPERTY C_STANDARD 11)
# if(APPLE)
target_compile_definitions(OSCPACK
PRIVATE
_M_X64
)
# endif(APPLE)
message(STATUS "Compiling 'OSCPack' from http://www.rossbencina.com/code/oscpack -- ${OSCPACK_INCLUDE_DIR}")
#####
##### Ressources
#####
set(RSC_DIR ${CMAKE_CURRENT_SOURCE_DIR}/rsc)
#
# Fonts
#
file(GLOB_RECURSE ROBOTO_REGULAR "${RSC_DIR}/*/Roboto-Regular.ttf")
if(NOT ROBOTO_REGULAR)
file(GLOB_RECURSE ROBOTO_REGULAR "/usr/share/fonts/*/Roboto-Regular.ttf")
message(STATUS "Copy ${ROBOTO_REGULAR} to ${RSC_DIR}/fonts")
file(COPY ${ROBOTO_REGULAR} DESTINATION ${RSC_DIR}/fonts)
set(ROBOTO_REGULAR "${RSC_DIR}/fonts/Roboto-Regular.ttf")
endif()
file(GLOB_RECURSE ROBOTO_BOLD "${RSC_DIR}/*/Roboto-Bold.ttf")
if(NOT ROBOTO_BOLD)
file(GLOB_RECURSE ROBOTO_BOLD "/usr/share/fonts/*/Roboto-Bold.ttf")
message(STATUS "Copy ${ROBOTO_BOLD} to ${RSC_DIR}/fonts")
file(COPY ${ROBOTO_BOLD} DESTINATION ${RSC_DIR}/fonts)
set(ROBOTO_BOLD "${RSC_DIR}/fonts/Roboto-Bold.ttf")
endif()
file(GLOB_RECURSE ROBOTO_ITALIC "${RSC_DIR}/*/Roboto-Italic.ttf")
if(NOT ROBOTO_ITALIC)
file(GLOB_RECURSE ROBOTO_ITALIC "/usr/share/fonts/*/Roboto-Italic.ttf")
message(STATUS "Copy ${ROBOTO_ITALIC} to ${RSC_DIR}/fonts")
file(COPY ${ROBOTO_ITALIC} DESTINATION ${RSC_DIR}/fonts)
set(ROBOTO_ITALIC "${RSC_DIR}/fonts/Roboto-Italic.ttf")
endif()
file(GLOB_RECURSE HACK_REGULAR "${RSC_DIR}/*/Hack-Regular.ttf")
if(NOT HACK_REGULAR)
file(GLOB_RECURSE HACK_REGULAR "/usr/share/fonts/*/Hack-Regular.ttf")
message(STATUS "Copy ${HACK_REGULAR} to ${RSC_DIR}/fonts")
file(COPY ${HACK_REGULAR} DESTINATION ${RSC_DIR}/fonts)
set(HACK_REGULAR "${RSC_DIR}/fonts/Hack-Regular.ttf")
endif()
file(GLOB_RECURSE AWESOME_SOLID "${RSC_DIR}/*/fa-solid-900.ttf")
if(NOT AWESOME_SOLID)
file(GLOB_RECURSE AWESOME_SOLID "/usr/share/fonts/*/fa-solid-900.ttf")
message(STATUS "Copy ${AWESOME_SOLID} to ${RSC_DIR}/fonts")
file(COPY ${AWESOME_SOLID} DESTINATION ${RSC_DIR}/fonts)
set(AWESOME_SOLID "${RSC_DIR}/fonts/fa-solid-900.ttf")
endif()
file(GLOB_RECURSE AWESOME_REGULAR "${RSC_DIR}/*/fa-regular-400.ttf")
if(NOT AWESOME_REGULAR)
file(GLOB_RECURSE AWESOME_REGULAR "/usr/share/fonts/*/fa-regular-400.ttf")
message(STATUS "Copy ${AWESOME_REGULAR} to ${RSC_DIR}/fonts")
file(COPY ${AWESOME_REGULAR} DESTINATION ${RSC_DIR}/fonts)
set(AWESOME_REGULAR "${RSC_DIR}/fonts/fa-regular-400.ttf")
endif()
include_directories(
"${RSC_DIR}/fonts"
)
#
# CMake RC module
#
# Include the CMake RC module
include(CMakeRC)
message(STATUS "Using 'CMakeRC ' from https://github.com/vector-of-bool/cmrc.git -- ${CMAKE_MODULE_PATH}.")
# set the files to package
set(VMIX_RSC_FILES
${ROBOTO_REGULAR}
${ROBOTO_BOLD}
${ROBOTO_ITALIC}
${HACK_REGULAR}
${AWESOME_REGULAR}
${AWESOME_SOLID}
./rsc/shaders/simple.fs
./rsc/shaders/simple.vs
./rsc/shaders/texture.fs
./rsc/shaders/texture.vs
./rsc/shaders/image.fs
./rsc/shaders/mask_elipse.fs
./rsc/shaders/mask_box.fs
./rsc/shaders/mask_round.fs
./rsc/shaders/mask_horizontal.fs
./rsc/shaders/mask_vertical.fs
./rsc/shaders/mask_draw.fs
./rsc/shaders/image.vs
./rsc/shaders/imageprocessing.fs
./rsc/shaders/imageblending.fs
./rsc/images/mask_vignette.png
./rsc/images/mask_halo.png
./rsc/images/mask_glow.png
./rsc/images/mask_circle.png
./rsc/images/mask_roundcorner.png
./rsc/images/mask_linear_top.png
./rsc/images/mask_linear_bottom.png
./rsc/images/mask_linear_left.png
./rsc/images/mask_linear_right.png
./rsc/images/vimix_256x256.png
./rsc/images/vimix_crow_white.png
./rsc/images/icons.dds
./rsc/images/gradient_0_cross_linear.png
./rsc/images/gradient_1_black_linear.png
./rsc/images/gradient_2_cross_quad.png
./rsc/images/gradient_3_black_quad.png
./rsc/images/transparencygrid.png
./rsc/images/shadow.dds
./rsc/images/glow.dds
./rsc/images/checker.dds
./rsc/images/shadow_perspective.dds
./rsc/images/soft_shadow.dds
./rsc/mesh/disk.ply
./rsc/mesh/circle.ply
./rsc/mesh/corner.ply
./rsc/mesh/shadow.ply
./rsc/mesh/glow.ply
./rsc/mesh/border_round_left.ply
./rsc/mesh/border_round.ply
./rsc/mesh/border_top.ply
./rsc/mesh/border_perspective_round_left.ply
./rsc/mesh/border_perspective_round.ply
./rsc/mesh/border_perspective_top.ply
./rsc/mesh/border_sharp.ply
./rsc/mesh/border_large_round_left.ply
./rsc/mesh/border_large_round.ply
./rsc/mesh/border_large_top.ply
./rsc/mesh/border_handles_rotation.ply
./rsc/mesh/border_handles_scale.ply
./rsc/mesh/border_handles_overlay.ply
./rsc/mesh/border_handles_overlay_filled.ply
./rsc/mesh/border_handles_sharp.ply
./rsc/mesh/border_handles_menu.ply
./rsc/mesh/border_handles_crop.ply
./rsc/mesh/border_handles_shape.ply
./rsc/mesh/border_handles_lock.ply
./rsc/mesh/border_handles_lock_open.ply
./rsc/mesh/border_handles_shadow.ply
./rsc/mesh/border_handles_arrows.ply
./rsc/mesh/border_handles_roundcorner.ply
./rsc/mesh/border_large_sharp.ply
./rsc/mesh/border_vertical_overlay.ply
./rsc/mesh/perspective_layer.ply
./rsc/mesh/perspective_axis_left.ply
./rsc/mesh/perspective_axis_right.ply
./rsc/mesh/shadow_perspective.ply
./rsc/mesh/point.ply
./rsc/mesh/square_point.ply
./rsc/mesh/triangle_point.ply
./rsc/mesh/icon_video.ply
./rsc/mesh/icon_image.ply
./rsc/mesh/icon_render.ply
./rsc/mesh/icon_pattern.ply
./rsc/mesh/icon_gear.ply
./rsc/mesh/icon_camera.ply
./rsc/mesh/icon_share.ply
./rsc/mesh/icon_clone.ply
./rsc/mesh/icon_vimix.ply
./rsc/mesh/icon_group_vimix.ply
./rsc/mesh/icon_circles.ply
./rsc/mesh/icon_empty.ply
./rsc/mesh/icon_lock.ply
./rsc/mesh/icon_unlock.ply
./rsc/mesh/icon_circle.ply
./rsc/mesh/icon_square.ply
./rsc/mesh/icon_cross.ply
./rsc/mesh/icon_clock.ply
./rsc/mesh/icon_clock_hand.ply
./rsc/mesh/icon_grid.ply
./rsc/mesh/icon_crop.ply
./rsc/mesh/icon_eye.ply
./rsc/mesh/icon_eye_slash.ply
./rsc/mesh/icon_tv.ply
./rsc/mesh/icon_cube.ply
./rsc/mesh/icon_sequence.ply
./rsc/mesh/icon_receive.ply
./rsc/mesh/icon_text.ply
./rsc/mesh/icon_play.ply
./rsc/mesh/icon_fastforward.ply
./rsc/mesh/icon_blend_normal.ply
./rsc/mesh/icon_blend_add.ply
./rsc/mesh/icon_blend_subtract.ply
./rsc/mesh/icon_blend_mult.ply
./rsc/mesh/icon_blend_soft_light.ply
./rsc/mesh/icon_blend_hard_light.ply
./rsc/mesh/icon_blend_soft_sub.ply
./rsc/mesh/icon_blend_lighten.ply
./rsc/mesh/h_line.ply
./rsc/mesh/h_mark.ply
./rsc/shaders/filters/default.glsl
./rsc/shaders/filters/blend.glsl
./rsc/shaders/filters/bloom.glsl
./rsc/shaders/filters/bokeh.glsl
./rsc/shaders/filters/talk.glsl
./rsc/shaders/filters/fisheye.glsl
./rsc/shaders/filters/blur.glsl
./rsc/shaders/filters/blur_1.glsl
./rsc/shaders/filters/blur_2.glsl
./rsc/shaders/filters/lens_1.glsl
./rsc/shaders/filters/lens_2.glsl
./rsc/shaders/filters/hashedblur.glsl
./rsc/shaders/filters/circularblur.glsl
./rsc/shaders/filters/hashederosion.glsl
./rsc/shaders/filters/hasheddilation.glsl
./rsc/shaders/filters/sharp.glsl
./rsc/shaders/filters/sharpen.glsl
./rsc/shaders/filters/sharpen_1.glsl
./rsc/shaders/filters/sharpen_2.glsl
./rsc/shaders/filters/contour_2.glsl
./rsc/shaders/filters/sharpenedge.glsl
./rsc/shaders/filters/chromakey.glsl
./rsc/shaders/filters/lumakey.glsl
./rsc/shaders/filters/coloralpha.glsl
./rsc/shaders/filters/bilinear.glsl
./rsc/shaders/filters/edge.glsl
./rsc/shaders/filters/sobel.glsl
./rsc/shaders/filters/freichen.glsl
./rsc/shaders/filters/kuwahara.glsl
./rsc/shaders/filters/pixelate.glsl
./rsc/shaders/filters/focus.glsl
./rsc/shaders/filters/denoise.glsl
./rsc/shaders/filters/noise.glsl
./rsc/shaders/filters/grain.glsl
./rsc/shaders/filters/stippling.glsl
./rsc/shaders/filters/dithering.glsl
./rsc/shaders/filters/erosion.glsl
./rsc/shaders/filters/dilation.glsl
./rsc/shaders/filters/tophat.glsl
./rsc/shaders/filters/blackhat.glsl
./rsc/shaders/filters/resample_double.glsl
./rsc/shaders/filters/resample_half.glsl
./rsc/shaders/filters/resample_quarter.glsl
./rsc/shaders/filters/earlybird.glsl
./rsc/shaders/filters/logo.glsl
./rsc/shaders/filters/whitebalance.glsl
./rsc/images/logo.vmx
)
cmrc_add_resource_library(vmix-resources ALIAS vmix::rc NAMESPACE vmix WHENCE rsc ${VMIX_RSC_FILES})
#####
##### DEFINE THE PACKAGING (all OS)
#####
SET(CPACK_PACKAGE_NAME "vimix")
SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "vimix\nReal-time video mixing for live performance.")
SET(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_SOURCE_DIR}/README.md")
SET(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_SOURCE_DIR}/COPYING.txt")
SET(CPACK_PACKAGE_CONTACT "bruno.herbelin@gmail.com")
SET(CPACK_PACKAGE_HOMEPAGE_URL "https://brunoherbelin.github.io/vimix")
SET(CPACK_PACKAGE_VERSION_MAJOR "${VIMIX_VERSION_MAJOR}")
SET(CPACK_PACKAGE_VERSION_MINOR "${VIMIX_VERSION_MINOR}")
SET(CPACK_PACKAGE_VERSION_PATCH "${VIMIX_VERSION_PATCH}")
SET(CPACK_PACKAGE_VENDOR "Bruno Herbelin")
SET(CPACK_SOURCE_IGNORE_FILES
"/\\\\.git/"
"/\\\\.gitignore$"
"/\\\\.gitmodules$"
)
set(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}_${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}_${CPACK_SYSTEM_NAME}")
set(CPACK_STRIP_FILES TRUE)
#####
##### Build Application
#####
add_subdirectory(src)
# To Create a package, run "cpack"
include(CPack)