]> git.sesse.net Git - kdenlive/blob - src/CMakeLists.txt
QString::toStdString() replaced by QString::toLocal8Bit() as KDE4
[kdenlive] / src / CMakeLists.txt
1 set(QT_USE_QTDBUS 1)
2 set(QT_USE_QTOPENGL 1)
3 set(QT_USE_QTSCRIPT 1)
4 set(QT_USE_QTSVG 1)
5 set(QT_USE_QTXML 1)
6
7 find_package(OpenGL REQUIRED)
8 if(APPLE)
9   find_package(SDL REQUIRED)
10 endif(APPLE)
11 macro_optional_find_package(Nepomuk)
12 macro_optional_find_package(QJSON)
13
14 option(WITH_V4L "Build capture support with Video4Linux" ON)
15 option(WITH_JogShuttle "Build Jog/Shuttle support" ON)
16 option(WITH_BlackMagic "Build Blackmagic Decklinkl support" ON)
17
18 if(WITH_V4L)
19   # This can be changed to support FreeBSD as soon as we move to a newer V4L2
20   # header.
21   check_include_files(linux/ioctl.h HAVE_LINUX_IOCTL_H)
22   if(HAVE_LINUX_IOCTL_H)
23     set(BUILD_V4L TRUE)
24   endif(HAVE_LINUX_IOCTL_H)
25 endif(WITH_V4L)
26
27 if(WITH_JogShuttle)
28   check_include_files(linux/input.h HAVE_LINUX_INPUT_H)
29   if(HAVE_LINUX_INPUT_H)
30     set(BUILD_JogShuttle TRUE)
31   endif(HAVE_LINUX_INPUT_H)
32 endif(WITH_JogShuttle)
33
34 if(WITH_BlackMagic)
35     set(BUILD_BlackMagic TRUE)
36 endif(WITH_BlackMagic)
37
38 macro_log_feature(QT_QTOPENGL_FOUND
39   "QtOpenGL"
40   "Qt bindings for the OpenGL library"
41   "http://qt.nokia.com/products/qt"
42   TRUE
43   ${QT_MIN_VERSION}
44   "QtOpenGL library and headers (most likely called libqt4-opengl and libqt4-opengl-dev)"
45 )
46
47 macro_log_feature(QT_QTSCRIPT_FOUND
48   "QtScript"
49   "Qt module providing core scripting facilities"
50   "http://qt.nokia.com/products/qt"
51   TRUE
52   ${QT_MIN_VERSION}
53   "QtScript library (most likely called libqt4-script)"
54 )
55
56 if(APPLE)
57   macro_log_feature(SDL_FOUND
58     "SDL"
59     "Cross-platform multimedia library"
60     "http://www.libsdl.org"
61     TRUE
62   )
63 endif(APPLE)
64
65 macro_log_feature(Nepomuk_FOUND
66   "Nepomuk"
67   "Support for the Nepomuk semantic desktop system"
68   "http://nepomuk.semanticdesktop.org"
69 )
70
71 macro_log_feature(QJSON_FOUND
72   "QJson"
73   "Qt-based library that maps JSON data to QVariant objects"
74   "http://qjson.sourceforge.net"
75   FALSE
76   ""
77   "Required to build the rotoscoping filter and for Freesound.org queries"
78 )
79
80
81 add_subdirectory(audioscopes)
82 add_subdirectory(beziercurve)
83 add_subdirectory(colorcorrection)
84 add_subdirectory(colorscopes)
85 add_subdirectory(commands)
86 add_subdirectory(projecttree)
87 add_subdirectory(utils)
88 add_subdirectory(databackup)
89 add_subdirectory(kiss_fft)
90 add_subdirectory(mimetypes)
91 add_subdirectory(onmonitoritems)
92 add_subdirectory(simplekeyframes)
93 add_subdirectory(stopmotion)
94
95 if(QJSON_FOUND)
96   add_subdirectory(onmonitoritems/rotoscoping)
97   add_subdirectory(rotoscoping)
98 endif(QJSON_FOUND)
99
100 if(BUILD_V4L)
101   add_subdirectory(v4l)
102 endif(BUILD_V4L)
103
104 if(BUILD_BlackMagic)
105   add_subdirectory(blackmagic)
106 endif(BUILD_BlackMagic)
107
108 list(APPEND kdenlive_SRCS
109   main.cpp
110   mainwindow.cpp
111
112   KoSliderCombo.cpp
113   abstractclipitem.cpp
114   abstractgroupitem.cpp
115   abstractmonitor.cpp
116   abstractscopewidget.cpp
117   archivewidget.cpp
118   audiosignal.cpp
119   choosecolorwidget.cpp
120   clipdurationdialog.cpp
121   clipitem.cpp
122   clipmanager.cpp
123   clipproperties.cpp
124   cliptranscode.cpp
125   clipstabilize.cpp
126   colorpickerwidget.cpp
127   colorplaneexport.cpp
128   colortools.cpp
129   complexparameter.cpp
130   cornerswidget.cpp
131   customruler.cpp
132   customtrackscene.cpp
133   customtrackview.cpp
134   docclipbase.cpp
135   documentchecker.cpp
136   documentvalidator.cpp
137   doubleparameterwidget.cpp
138   dragvalue.cpp
139   dvdwizard.cpp
140   dvdwizardchapters.cpp
141   dvdwizardmenu.cpp
142   dvdwizardvob.cpp
143   effectslist.cpp
144   effectslistview.cpp
145   effectslistwidget.cpp
146   effectstackedit.cpp
147   effectstackview.cpp
148   encodingprofilesdialog.cpp
149   folderprojectitem.cpp
150   gentime.cpp
151   geometryval.cpp
152   geometrywidget.cpp
153   graphicsscenerectmove.cpp
154   guide.cpp
155   headertrack.cpp
156   initeffects.cpp
157   kdenlivedoc.cpp
158   kdenlivesettingsdialog.cpp
159   keyframeedit.cpp
160   keyframehelper.cpp
161   kis_cubic_curve.cpp
162   kis_curve_widget.cpp
163   kthumb.cpp
164   managecapturesdialog.cpp
165   markerdialog.cpp
166   mltdevicecapture.cpp
167   monitor.cpp
168   monitoreditwidget.cpp
169   monitormanager.cpp
170   monitorscene.cpp
171   noteswidget.cpp
172   parameterplotter.cpp
173   positionedit.cpp
174   profilesdialog.cpp
175   projectitem.cpp
176   projectlist.cpp
177   projectlistview.cpp
178   projectsettings.cpp
179   recmonitor.cpp
180   renderer.cpp
181   renderwidget.cpp
182   slideshowclip.cpp
183   smallruler.cpp
184   spacerdialog.cpp
185   statusbarmessagelabel.cpp
186   subprojectitem.cpp
187   timecode.cpp
188   timecodedisplay.cpp
189   titledocument.cpp
190   titlewidget.cpp
191   trackdialog.cpp
192   tracksconfigdialog.cpp
193   trackview.cpp
194   transition.cpp
195   transitionsettings.cpp
196   unicodedialog.cpp
197   wizard.cpp
198 )
199
200 kde4_add_ui_files(kdenlive_UIS
201   widgets/addtrack_ui.ui
202   widgets/archivewidget_ui.ui
203   widgets/audiospectrum_ui.ui
204   widgets/backupdialog_ui.ui
205   widgets/bezierspline_ui.ui
206   widgets/boolval_ui.ui
207   widgets/clipdurationdialog_ui.ui
208   widgets/clipproperties_ui.ui
209   widgets/cliptranscode_ui.ui
210   widgets/clipstabilize_ui.ui
211   widgets/colorclip_ui.ui
212   widgets/colorplaneexport_ui.ui
213   widgets/configcapture_ui.ui
214   widgets/configenv_ui.ui
215   widgets/configjogshuttle_ui.ui
216   widgets/configmisc_ui.ui
217   widgets/configproject_ui.ui
218   widgets/configsdl_ui.ui
219   widgets/configtimeline_ui.ui
220   widgets/configtranscode_ui.ui
221   widgets/dvdwizardchapters_ui.ui
222   widgets/dvdwizardmenu_ui.ui
223   widgets/dvdwizardstatus_ui.ui
224   widgets/dvdwizardvob_ui.ui
225   widgets/effectlist_ui.ui
226   widgets/effectstack_ui.ui
227   widgets/freesound_ui.ui
228   widgets/geometryval_ui.ui
229   widgets/geometrywidget_ui.ui
230   widgets/histogram_ui.ui
231   widgets/keyframedialog_ui.ui
232   widgets/keyframeeditor_ui.ui
233   widgets/keyframewidget_ui.ui
234   widgets/listval_ui.ui
235   widgets/managecaptures_ui.ui
236   widgets/manageencodingprofile_ui.ui
237   widgets/markerdialog_ui.ui
238   widgets/missingclips_ui.ui
239   widgets/monitoreditwidget_ui.ui
240   widgets/profiledialog_ui.ui
241   widgets/projectsettings_ui.ui
242   widgets/recmonitor_ui.ui
243   widgets/renderwidget_ui.ui
244   widgets/rgbparade_ui.ui
245   widgets/saveprofile_ui.ui
246   widgets/slideshowclip_ui.ui
247   widgets/smconfig_ui.ui
248   widgets/spacerdialog_ui.ui
249   widgets/spectrogram_ui.ui
250   widgets/stopmotion_ui.ui
251   widgets/templateclip_ui.ui
252   widgets/timeline_ui.ui
253   widgets/timelinebuttons_ui.ui
254   widgets/titlewidget_ui.ui
255   widgets/trackheader_ui.ui
256   widgets/tracksconfigdialog_ui.ui
257   widgets/transitionsettings_ui.ui
258   widgets/unicodedialog_ui.ui
259   widgets/urlval_ui.ui
260   widgets/vectorscope_ui.ui
261   widgets/waveform_ui.ui
262   widgets/wipeval_ui.ui
263   widgets/wizardcapture_ui.ui
264   widgets/wizardcheck_ui.ui
265   widgets/wizardextra_ui.ui
266   widgets/wizardmltcheck_ui.ui
267   widgets/wizardstandard_ui.ui
268   widgets/keywordval_ui.ui
269   widgets/fontval_ui.ui
270   widgets/cutjobdialog_ui.ui
271 )
272
273 if(OPENGL_FOUND)
274   list(APPEND kdenlive_SRCS videoglwidget.cpp)
275 endif(OPENGL_FOUND)
276
277 if(BUILD_JogShuttle)
278   list(APPEND kdenlive_SRCS
279     jogaction.cpp
280     jogshuttle.cpp
281     jogshuttleconfig.cpp
282   )
283 endif(BUILD_JogShuttle)
284
285 kde4_add_kcfg_files(kdenlive_SRCS kdenlivesettings.kcfgc)
286 qt4_add_dbus_adaptor(kdenlive_SRCS
287   org.kdenlive.MainWindow.xml
288   mainwindow.h
289   MainWindow
290 )
291 qt4_add_resources(kdenlive_SRCS widgets/resources.qrc)
292 kde4_add_executable(kdenlive
293   ${kdenlive_SRCS}
294   ${kdenlive_UIS}
295 )
296
297 # To compile kiss_fft.
298 set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} --std=c99")
299
300 # KDE definitions and include directories *must* always come first, Qt follows
301 # (to avoid breaking builds when KDE and/or Qt are installed to different
302 # prefixes).
303 add_definitions(${KDE4_DEFINITIONS})
304
305 include_directories(
306   ${CMAKE_BINARY_DIR}
307   ${KDE4_INCLUDES} # Adds Qt include directories too.
308   ${LIBMLT_INCLUDE_DIR}
309   ${LIBMLTPLUS_INCLUDE_DIR}
310 )
311
312 # Adds Qt definitions and include directories, and sets QT_LIBRARIES according
313 # to the components requested in find_package().
314 include(${QT_USE_FILE})
315
316 if(${KDE_VERSION} VERSION_LESS 4.3.80)
317   set(KDE4_KNEWSTUFF_LIBS ${KDE4_KNEWSTUFF2_LIBS})
318 else(${KDE_VERSION} VERSION_LESS 4.3.80)
319   set(KDE4_KNEWSTUFF_LIBS ${KDE4_KNEWSTUFF3_LIBS})
320 endif(${KDE_VERSION} VERSION_LESS 4.3.80)
321
322 target_link_libraries(kdenlive
323   ${KDE4_KDEUI_LIBS}
324   ${KDE4_KIO_LIBS}
325   ${KDE4_KNEWSTUFF_LIBS}
326   ${KDE4_KNOTIFYCONFIG_LIBRARY}
327   ${KDE4_KROSSUI_LIBS}
328   ${KDE4_SOLID_LIBS}
329   ${QT_LIBRARIES}
330   ${LIBMLT_LIBRARY}
331   ${LIBMLTPLUS_LIBRARY}
332   ${CMAKE_DL_LIBS}
333   ${CMAKE_THREAD_LIBS_INIT}
334 )
335
336 if(Q_WS_X11)
337   include_directories(${X11_Xlib_INCLUDE_PATH})
338   target_link_libraries(kdenlive ${X11_LIBRARIES})
339 endif(Q_WS_X11)
340
341 if(OPENGL_FOUND AND QT_QTOPENGL_FOUND)
342   add_definitions(-DUSE_OPENGL)
343   target_link_libraries(kdenlive ${OPENGL_LIBRARIES})
344 endif(OPENGL_FOUND AND QT_QTOPENGL_FOUND)
345
346 if(SDL_FOUND)
347   target_link_libraries(kdenlive ${SDL_LIBRARY})
348 endif(SDL_FOUND)
349
350 if(Nepomuk_FOUND)
351   add_definitions(-DUSE_NEPOMUK)
352   include_directories(${NEPOMUK_INCLUDES})
353   target_link_libraries(kdenlive ${NEPOMUK_LIBRARIES})
354 endif(Nepomuk_FOUND)
355
356 if(QJSON_FOUND)
357   add_definitions(-DUSE_QJSON)
358   include_directories(${QJSON_INCLUDE_DIR})
359   target_link_libraries(kdenlive ${QJSON_LIBRARIES})
360 endif(QJSON_FOUND)
361
362 if(BUILD_V4L)
363   add_definitions(-DUSE_V4L)
364 endif(BUILD_V4L)
365
366 if(BUILD_BlackMagic)
367   add_definitions(-DUSE_BLACKMAGIC)
368 endif(BUILD_BlackMagic)
369
370 if(BUILD_JogShuttle)
371   add_definitions(-DUSE_JOGSHUTTLE)
372 endif(BUILD_JogShuttle)
373
374 install(TARGETS kdenlive DESTINATION ${BIN_INSTALL_DIR})
375 install(FILES
376   kdenliveui.rc
377   kdenlive.notifyrc
378   DESTINATION ${DATA_INSTALL_DIR}/kdenlive
379 )
380 install(FILES kdenlivesettings.kcfg DESTINATION ${KCFG_INSTALL_DIR})
381 install(FILES
382   kdenlive_projectprofiles.knsrc
383   kdenlive_renderprofiles.knsrc
384   kdenlive_titles.knsrc
385   kdenlive_wipes.knsrc
386   kdenlivetranscodingrc
387   DESTINATION ${CONFIG_INSTALL_DIR}
388 )
389 kde4_install_icons(${ICON_INSTALL_DIR})
390 install(FILES kdenlive.desktop DESTINATION ${XDG_APPS_INSTALL_DIR})