forked from mltframework/mlt
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
285 lines (234 loc) · 7.5 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
cmake_minimum_required(VERSION 3.14)
project(MLT
VERSION 6.25.0
DESCRIPTION "Multimedia Framework"
HOMEPAGE_URL "https://www.mltframework.org"
LANGUAGES C CXX
)
option(GPL "Enable GPLv2 modules" ON)
option(GPL3 "Enable GPLv3 modules" ON)
option(BUILD_TESTING "Enable tests" OFF)
option(BUILD_DOCS "Enable Doxygen documentation" OFF)
option(MOD_AVFORMAT "Enable avformat module" ON)
option(MOD_DECKLINK "Enable decklink module" ON)
option(MOD_FEEDS "Enable feeds module" ON)
option(MOD_FREI0R "Enable frei0r module" ON)
option(MOD_GDK "Enable gdk module" ON)
option(MOD_GTK2 "Enable gtk2 module" ON)
option(MOD_JACKRACK "Enable jackrack module" ON)
option(MOD_KDENLIVE "Enable kdenlive module" ON)
option(MOD_LUMAS "Enable lumas module" ON)
option(MOD_MOTION_EST "Enable motion estimation module" ON)
option(MOD_NORMALIZE "Enable normalize module" ON)
option(MOD_OLDFILM "Enable oldfilm module" ON)
option(MOD_OPENCV "Enable OpenCV module" ON)
option(MOD_OPENGL "Enable OpenGL module" ON)
option(MOD_PLUS "Enable plus module" ON)
option(MOD_PLUSGPL "Enable plus GPL module" ON)
option(MOD_QT "Enable Qt module" ON)
option(MOD_RESAMPLE "Enable resample module" ON)
option(MOD_RTAUDIO "Enable RtAudio module" ON)
option(MOD_RUBBERBAND "Enable rubberband module" ON)
option(MOD_SDL1 "Enable SDL1 module" ON)
option(MOD_SDL2 "Enable SDL2 module" ON)
option(MOD_SOX "Enable SoX module" ON)
option(MOD_VIDSTAB "Enable vid.stab module" ON)
option(MOD_VMFX "Enable vmfx module" ON)
option(MOD_VORBIS "Enable Vorbis module" ON)
option(MOD_XINE "Enable xine module" ON)
option(MOD_XML "Enable XML module" ON)
option(SWIG_CSHARP "Enable SWIG CSharp bindings" OFF)
option(SWIG_JAVA "Enable SWIG Java bindings" OFF)
option(SWIG_LUA "Enable SWIG Lua bindings" OFF)
option(SWIG_NODEJS "Enable SWIG Node.js bindings" OFF)
option(SWIG_PERL "Enable SWIG Perl bindings" OFF)
option(SWIG_PHP "Enable SWIG PHP bindings" OFF)
option(SWIG_PYTHON "Enable SWIG Python bindings" OFF)
option(SWIG_RUBY "Enable SWIG Ruby bindings" OFF)
option(SWIG_TCL "Enable SWIG Tcl bindings" OFF)
if(WIN32)
option(NODEPLOY "Keep bin/ lib/ layout on Windows" ON)
endif()
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
include(GNUInstallDirs)
set(CMAKE_C_STANDARD 11)
set(CMAKE_C_STANDARD_REQUIRED ON)
set(CMAKE_C_EXTENSIONS ON)
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
if(CMAKE_SYSTEM_PROCESSOR MATCHES "(x86_64)|(AMD64)")
if(${ARCH} MATCHES "i686")
else()
set(X86_64 ON)
if(NOT MSVC)
add_compile_definitions(USE_MMX USE_SSE USE_SSE2 ARCH_X86_64)
endif()
endif()
endif()
if(CMAKE_C_COMPILER_ID MATCHES "GNU|Clang")
add_compile_options(-ffast-math)
elseif(MSVC)
add_compile_options(/fp:fast)
endif()
find_package(Threads REQUIRED)
find_package(PkgConfig REQUIRED)
if(WIN32)
find_package(Iconv REQUIRED)
if(NOT CMAKE_DL_LIBS)
find_package(dlfcn-win32 REQUIRED)
set(CMAKE_DL_LIBS dlfcn-win32::dl)
endif()
endif()
pkg_check_modules(sdl2 IMPORTED_TARGET GLOBAL sdl2)
if(BUILD_TESTING)
find_package(Qt5 REQUIRED COMPONENTS Core Test)
find_package(Kwalify REQUIRED)
enable_testing()
endif()
if(MOD_QT)
find_package(Qt5 COMPONENTS Core Gui Xml Svg Widgets)
endif()
if(MOD_QT OR MOD_PLUS)
pkg_check_modules(FFTW IMPORTED_TARGET fftw3)
if(NOT FFTW_FOUND)
pkg_check_modules(FFTW IMPORTED_TARGET fftw)
endif()
endif()
if(MOD_QT OR MOD_GDK)
pkg_check_modules(libexif IMPORTED_TARGET libexif)
endif()
if(MOD_GDK OR MOD_GTK)
pkg_check_modules(fontconfig IMPORTED_TARGET fontconfig)
endif()
if(MOD_XML OR MOD_JACKRACK)
pkg_check_modules(xml IMPORTED_TARGET libxml-2.0)
endif()
if(MOD_AVFORMAT)
pkg_check_modules(libavformat IMPORTED_TARGET libavformat)
pkg_check_modules(libswscale IMPORTED_TARGET libswscale)
pkg_check_modules(libavutil IMPORTED_TARGET libavutil)
pkg_check_modules(libavcodec IMPORTED_TARGET libavcodec)
pkg_check_modules(libavfilter IMPORTED_TARGET libavfilter)
pkg_check_modules(libavdevice IMPORTED_TARGET libavdevice)
pkg_check_modules(libswresample IMPORTED_TARGET libswresample)
endif()
if(MOD_FREI0R)
pkg_check_modules(FREI0R frei0r)
endif()
if(MOD_GDK)
pkg_check_modules(GdkPixbuf IMPORTED_TARGET gdk-pixbuf-2.0)
pkg_check_modules(pango IMPORTED_TARGET pango)
pkg_check_modules(pangoft2 IMPORTED_TARGET pangoft2)
endif()
if(MOD_GTK2)
find_package(GTK2 COMPONENTS gtk)
pkg_check_modules(harfbuzz IMPORTED_TARGET harfbuzz)
endif()
if(MOD_JACKRACK)
pkg_check_modules(jack IMPORTED_TARGET jack)
pkg_check_modules(glib IMPORTED_TARGET glib-2.0)
check_include_file(ladspa.h ladspa_h_FOUND)
endif()
if(MOD_OPENCV)
find_package(OpenCV QUIET OPTIONAL_COMPONENTS tracking)
endif()
if(MOD_OPENGL)
pkg_check_modules(movit IMPORTED_TARGET movit)
find_package(OpenGL)
if(UNIX AND NOT APPLE)
find_package(X11)
if(NOT TARGET X11::X11)
set(MOD_OPENGL OFF)
endif()
endif()
endif()
if(MOD_PLUS)
pkg_check_modules(libebur128 IMPORTED_TARGET libebur128)
endif()
if(MOD_RESAMPLE)
pkg_check_modules(samplerate IMPORTED_TARGET samplerate)
endif()
if(MOD_RTAUDIO)
pkg_check_modules(rtaudio IMPORTED_TARGET rtaudio)
if(NOT TARGET PkgConfig::rtaudio AND UNIX AND NOT APPLE)
pkg_check_modules(alsa IMPORTED_TARGET alsa)
pkg_check_modules(libpulse-simple IMPORTED_TARGET libpulse-simple)
endif()
endif()
if(MOD_RUBBERBAND)
pkg_check_modules(rubberband IMPORTED_TARGET rubberband)
endif()
if(MOD_SDL1)
pkg_check_modules(sdl IMPORTED_TARGET sdl)
pkg_check_modules(sdl_image IMPORTED_TARGET SDL_image)
endif()
if(MOD_SOX)
pkg_check_modules(sox IMPORTED_TARGET sox)
endif()
if(MOD_VIDSTAB)
pkg_check_modules(vidstab IMPORTED_TARGET vidstab)
endif()
if(MOD_VORBIS)
pkg_check_modules(vorbis IMPORTED_TARGET vorbis)
pkg_check_modules(vorbisfile IMPORTED_TARGET vorbisfile)
endif()
find_package(SWIG)
if(SWIG_CSHARP)
find_package(Mono)
endif()
if(SWIG_JAVA)
find_package(JNI)
endif()
if(SWIG_LUA)
find_package(Lua)
endif()
if(SWIG_NODEJS)
find_package(Node)
if(NODE_VERSION_MAJOR VERSION_GREATER_EQUAL 12 AND SWIG_VERSION VERSION_LESS 4.1)
# https://github.com/swig/swig/issues/1520
set(SWIG_NODEJS OFF)
endif()
endif()
if(SWIG_PERL)
find_package(PerlLibs)
endif()
if(SWIG_PHP)
find_package(PHP)
endif()
if(SWIG_PYTHON)
find_package(Python3 COMPONENTS Interpreter Development)
endif()
if(SWIG_RUBY)
find_package(Ruby)
endif()
if(SWIG_TCL)
find_package(TCL)
endif()
if(BUILD_DOCS)
find_package(Doxygen REQUIRED)
set(DOXYGEN_OUTPUT_DIRECTORY "docs")
set(DOXYGEN_ABBREVIATE_BRIEF "")
set(DOXYGEN_STRIP_FROM_PATH "src/framework/")
set(DOXYGEN_JAVADOC_AUTOBRIEF "YES")
set(DOXYGEN_QT_AUTOBRIEF "YES")
set(DOXYGEN_ALIASES "properties=\\xrefitem properties \\\"Property\\\" \\\"Properties Dictionary\\\"")
list(APPEND DOXYGEN_ALIASES "event=\\xrefitem event \\\"Event\\\" \\\"Events Dictionary\\\"")
list(APPEND DOXYGEN_ALIASES "envvar=\\xrefitem envvars \\\"Environment Variable\\\" \\\"Environment Variables\\\"")
set(DOXYGEN_OPTIMIZE_OUTPUT_FOR_C "YES")
set(DOXYGEN_SORT_BRIEF_DOCS "YES")
set(DOXYGEN_EXTRACT_ALL "YES")
set(DOXYGEN_EXTRACT_PRIVATE "YES")
set(DOXYGEN_EXTRACT_STATIC "YES")
set(DOXYGEN_FILE_PATTERNS "")
set(DOXYGEN_RECURSIVE "NO")
set(DOXYGEN_EXCLUDE_PATTERNS "")
set(DOXYGEN_EXAMPLE_PATTERNS "")
set(DOXYGEN_SEARCHENGINE "NO")
doxygen_add_docs(docs src/framework)
endif()
install(DIRECTORY presets profiles DESTINATION ${CMAKE_INSTALL_DATADIR}/mlt)
if(UNIX AND NOT APPLE)
install(FILES docs/melt.1 DESTINATION ${CMAKE_INSTALL_MANDIR}/man1)
endif()
add_subdirectory(src)