CMakeLists.txt 11.2 KB
Newer Older
1
2
3
4
5
#
# VLMC build system
# Authors: Rohit Yadav <rohityadav89@gmail.com>
#          Ludovic Fauvet <etix@vlmc.org>
#
Ludovic Fauvet's avatar
Ludovic Fauvet committed
6

7
SET(VLMC_SRCS
Ludovic Fauvet's avatar
Ludovic Fauvet committed
8
    Commands/Commands.cpp
9
10
    Settings/SettingsManager.cpp
    Settings/SettingValue.cpp
Ludovic Fauvet's avatar
Ludovic Fauvet committed
11
    Library/Library.cpp
12
    Library/MediaContainer.cpp
Ludovic Fauvet's avatar
Ludovic Fauvet committed
13
14
15
16
17
18
19
20
21
    LibVLCpp/VLCInstance.cpp
    LibVLCpp/VLCMedia.cpp
    LibVLCpp/VLCMediaPlayer.cpp
    LibVLCpp/VLCpp.hpp
    Media/Clip.cpp
    Media/Media.cpp
    Metadata/MetaDataManager.cpp
    Metadata/MetaDataWorker.cpp
    Project/ProjectManager.cpp
22
23
    Project/Workspace.cpp
    Project/WorkspaceWorker.cpp
Ludovic Fauvet's avatar
Ludovic Fauvet committed
24
    Renderer/ClipRenderer.cpp
25
    Renderer/GenericRenderer.cpp
Ludovic Fauvet's avatar
Ludovic Fauvet committed
26
27
    Renderer/WorkflowFileRenderer.cpp
    Renderer/WorkflowRenderer.cpp
28
    Tools/ErrorHandler.cpp
Ludovic Fauvet's avatar
Ludovic Fauvet committed
29
30
31
32
33
34
35
36
    Tools/Pool.hpp
    Tools/QSingleton.hpp
    Tools/Singleton.hpp
    Tools/Toggleable.hpp
    Tools/VlmcDebug.cpp
    Tools/WaitCondition.hpp
    Workflow/AudioClipWorkflow.cpp 
    Workflow/ClipWorkflow.cpp
37
    Workflow/ClipHelper.cpp
Ludovic Fauvet's avatar
Ludovic Fauvet committed
38
39
    Workflow/ImageClipWorkflow.cpp
    Workflow/MainWorkflow.cpp
40
    Workflow/StackedBuffer.hpp
Ludovic Fauvet's avatar
Ludovic Fauvet committed
41
42
    Workflow/TrackHandler.cpp
    Workflow/TrackWorkflow.cpp
43
    Workflow/Types.cpp
Ludovic Fauvet's avatar
Ludovic Fauvet committed
44
45
46
    Workflow/VideoClipWorkflow.cpp
  )

47
IF (WIN32)
Hugo Beauzee-Luyssen's avatar
Hugo Beauzee-Luyssen committed
48
    LIST ( APPEND VLMC_SRCS Main/winvlmc.cpp )
49
ELSE (WIN32)
50
    LIST( APPEND VLMC_SRCS Main/vlmc.cpp )
51
52
ENDIF(WIN32)

Ludovic Fauvet's avatar
Ludovic Fauvet committed
53
SET (VLMC_HDRS
54
55
    Settings/SettingsManager.h
    Settings/SettingValue.h
Ludovic Fauvet's avatar
Ludovic Fauvet committed
56
    Library/Library.h
57
    Library/MediaContainer.h
58
    LibVLCpp/VLCInstance.h
Ludovic Fauvet's avatar
Ludovic Fauvet committed
59
60
61
62
63
64
    LibVLCpp/VLCMediaPlayer.h
    Media/Clip.h
    Media/Media.h
    Metadata/MetaDataManager.h
    Metadata/MetaDataWorker.h
    Project/ProjectManager.h
65
66
    Project/Workspace.h
    Project/WorkspaceWorker.h
Ludovic Fauvet's avatar
Ludovic Fauvet committed
67
68
69
70
    Renderer/ClipRenderer.h
    Renderer/GenericRenderer.h
    Renderer/WorkflowFileRenderer.h
    Renderer/WorkflowRenderer.h
71
    Tools/ErrorHandler.h
Ludovic Fauvet's avatar
Ludovic Fauvet committed
72
    Tools/VlmcDebug.h
Ludovic Fauvet's avatar
Ludovic Fauvet committed
73
    Workflow/AudioClipWorkflow.h 
Ludovic Fauvet's avatar
Ludovic Fauvet committed
74
    Workflow/ClipWorkflow.h
75
    Workflow/ClipHelper.h
Ludovic Fauvet's avatar
Ludovic Fauvet committed
76
    Workflow/ImageClipWorkflow.h
Ludovic Fauvet's avatar
Ludovic Fauvet committed
77
78
79
    Workflow/MainWorkflow.h
    Workflow/TrackHandler.h
    Workflow/TrackWorkflow.h
80
    Workflow/Types.h
Ludovic Fauvet's avatar
Ludovic Fauvet committed
81
    Workflow/VideoClipWorkflow.h
Ludovic Fauvet's avatar
Ludovic Fauvet committed
82
83
84
  )

SET(VLMC_RCC
85
86
    ../resources.qrc
    ../ts/resources-ts.qrc
Ludovic Fauvet's avatar
Ludovic Fauvet committed
87
88
  )

89
90
91
92
IF (WIN32)
    LIST( APPEND VLMC_RCC ../resources/styles.qrc )
ENDIF (WIN32)

Ludovic Fauvet's avatar
Ludovic Fauvet committed
93
94
95
96
97
98
#include paths for vlmc
INCLUDE_DIRECTORIES(
  ${CMAKE_CURRENT_BINARY_DIR}
  ${CMAKE_CURRENT_BINARY_DIR}/src
  .
  Commands
99
  Settings 
Ludovic Fauvet's avatar
Ludovic Fauvet committed
100
101
102
  Gui
  Gui/import
  Gui/library
103
  Gui/media
104
  Gui/preview
Ludovic Fauvet's avatar
Ludovic Fauvet committed
105
106
107
108
109
110
111
112
113
114
115
116
117
118
  Gui/settings
  Gui/timeline
  Gui/widgets
  Gui/wizard
  Library
  LibVLCpp
  Media
  Metadata
  Project
  Renderer
  Tools
  Workflow
)

119
120
CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/cmake/config.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config.h)

121
IF (NOT WITH_GUI)
122
123
    LIST (APPEND VLMC_SRCS Main/main.cpp Renderer/ConsoleRenderer.cpp )
    LIST (APPEND VLMC_HDRS Renderer/ConsoleRenderer.h)
124
125
    QT4_ADD_RESOURCES(VLMC_RCC_SRCS ${VLMC_RCC})
    QT4_WRAP_CPP(VLMC_MOC_SRCS ${VLMC_HDRS})
126
127
128
129
130
131
132
    ADD_EXECUTABLE(vlmc ${GUI_TYPE} ${VLMC_SRCS} ${VLMC_MOC_SRCS} ${VLMC_RCC_SRCS})
    TARGET_LINK_LIBRARIES(vlmc
      ${QT_QTCORE_LIBRARY} 
      ${QT_QTXML_LIBRARY} 
      ${LIBVLC_LIBRARY}
      ${LIBVLCCORE_LIBRARY}
      )
Ludovic Fauvet's avatar
Ludovic Fauvet committed
133

134
#Add GUI stuff if required
135
136
ELSE(NOT WITH_GUI)
     LIST( APPEND VLMC_SRCS
137
138
        Commands/KeyboardShortcutHelper.cpp
        Main/guimain.cpp
139
        Media/Transcoder.cpp #Won't be needed without the import, so let's put it in GUI list
140
141
142
143
144
        Gui/About.cpp
        Gui/AudioSpectrumDrawer.cpp
        Gui/ClickableLabel.cpp
        Gui/ClipProperty.cpp
        Gui/DockWidgetManager.cpp
145
        Gui/IntroDialog.cpp
146
147
148
149
150
151
152
        Gui/LanguageHelper.cpp
        Gui/preview/LCDTimecode.cpp
        Gui/MainWindow.cpp
        Gui/import/TagWidget.cpp
        Gui/UndoStack.cpp
        Gui/WorkflowFileRendererDialog.cpp
        Gui/export/RendererSettings.cpp
Rohit Yadav's avatar
Rohit Yadav committed
153
        Gui/export/ShareOnYoutube.cpp
154
155
156
        Gui/import/ImportController.cpp
        Gui/library/ListViewController.cpp
        Gui/library/MediaCellView.cpp
157
        Gui/library/MediaLibrary.cpp
158
159
160
        Gui/library/MediaListView.cpp
        Gui/library/StackViewController.cpp
        Gui/library/StackViewNavController.cpp
161
        Gui/media/GuiMedia.cpp
162
        Gui/media/ClipMetadataDisplayer.cpp
163
        Gui/project/GuiProjectManager.cpp
164
165
        Gui/preview/PreviewRuler.cpp
        Gui/preview/PreviewWidget.cpp
166
167
168
169
170
171
172
        Gui/settings/BoolWidget.cpp
        Gui/settings/DoubleWidget.cpp
        Gui/settings/IntWidget.cpp
        Gui/settings/KeyboardShortcut.cpp
        Gui/settings/KeyboardShortcutInput.cpp
        Gui/settings/LanguageWidget.cpp
        Gui/settings/Panel.cpp
173
        Gui/settings/PathWidget.cpp
174
175
176
177
178
179
180
181
182
183
184
185
186
        Gui/settings/PreferenceWidget.cpp
        Gui/settings/Settings.cpp
        Gui/settings/StringWidget.cpp
        Gui/timeline/AbstractGraphicsMediaItem.cpp
        Gui/timeline/GraphicsAudioItem.cpp
        Gui/timeline/GraphicsCursorItem.cpp
        Gui/timeline/GraphicsMovieItem.cpp
        Gui/timeline/GraphicsTrack.cpp
        Gui/timeline/Timeline.cpp
        Gui/timeline/TracksControls.cpp
        Gui/timeline/TracksRuler.cpp
        Gui/timeline/TracksScene.cpp
        Gui/timeline/TracksView.cpp
187
        Gui/widgets/ElidableLabel.cpp
188
        Gui/widgets/FramelessButton.cpp
189
        Gui/widgets/NotificationZone.cpp
190
        Gui/widgets/SearchLineEdit.cpp
191
192
193
194
195
196
197
198
199
        Gui/widgets/TrackControls.cpp
        Gui/wizard/GeneralPage.cpp
        Gui/wizard/OpenPage.cpp
        Gui/wizard/ProjectWizard.cpp
        Gui/wizard/VideoPage.cpp
        Gui/wizard/WelcomePage.cpp
        )

    LIST( APPEND VLMC_HDRS
200
        Commands/KeyboardShortcutHelper.h
201
        Media/Transcoder.h #Won't be needed without the import, so let's put it in GUI list
202
203
204
205
206
        Gui/About.h
        Gui/ClickableLabel.h
        Gui/ClipProperty.h
        Gui/DockWidgetManager.h
        Gui/export/RendererSettings.h
Rohit Yadav's avatar
Rohit Yadav committed
207
        Gui/export/ShareOnYoutube.h
208
        Gui/import/ImportController.h
209
        Gui/IntroDialog.h
210
        Gui/LanguageHelper.h
211
        Gui/import/TagWidget.h
212
213
        Gui/library/ListViewController.h
        Gui/library/MediaCellView.h
214
        Gui/library/MediaLibrary.h
215
216
217
218
219
        Gui/library/MediaListView.h
        Gui/library/StackViewController.h
        Gui/library/StackViewNavController.h
        Gui/library/ViewController.h
        Gui/MainWindow.h
220
        Gui/media/ClipMetadataDisplayer.h
221
        Gui/media/GuiMedia.h
222
        Gui/preview/LCDTimecode.h
223
224
        Gui/preview/PreviewRuler.h
        Gui/preview/PreviewWidget.h
225
        Gui/project/GuiProjectManager.h
226
        Gui/settings/KeyboardShortcut.h
227
        Gui/settings/KeyboardShortcutInput.h
228
229
230
231
232
        Gui/settings/BoolWidget.h
        Gui/settings/DoubleWidget.h
        Gui/settings/IntWidget.h
        Gui/settings/ISettingsCategoryWidget.h
        Gui/settings/LanguageWidget.h
233
        Gui/settings/PathWidget.h
234
235
        Gui/settings/PreferenceWidget.h
        Gui/settings/StringWidget.h
236
237
238
239
240
241
242
243
244
245
246
247
248
249
        Gui/settings/Panel.h
        Gui/settings/PreferenceWidget.h
        Gui/settings/Settings.h
        Gui/timeline/AbstractGraphicsMediaItem.h
        Gui/timeline/GraphicsAudioItem.h 
        Gui/timeline/GraphicsCursorItem.h
        Gui/timeline/GraphicsMovieItem.h 
        Gui/timeline/GraphicsTrack.h
        Gui/timeline/Timeline.h
        Gui/timeline/TracksControls.h
        Gui/timeline/TracksRuler.h
        Gui/timeline/TracksScene.h
        Gui/timeline/TracksView.h
        Gui/UndoStack.h
250
        Gui/widgets/ElidableLabel.h
251
        Gui/widgets/FramelessButton.h
252
        Gui/widgets/NotificationZone.h
253
        Gui/widgets/SearchLineEdit.h
254
255
256
257
258
259
260
261
262
263
264
        Gui/widgets/TrackControls.h
        Gui/wizard/GeneralPage.h
        Gui/wizard/OpenPage.h
        Gui/wizard/ProjectWizard.h
        Gui/wizard/VideoPage.h
        Gui/wizard/WelcomePage.h
        Gui/WorkflowFileRendererDialog.h
        )
     
    SET(VLMC_UIS
        Gui/export/RendererSettings.ui
Rohit Yadav's avatar
Rohit Yadav committed
265
        Gui/export/ShareOnYoutube.ui
266
267
268
        Gui/import/ui/ImportController.ui
        Gui/library/StackViewNavController.ui
        Gui/library/ui/MediaCellView.ui
269
        Gui/library/ui/MediaLibrary.ui
270
271
272
        Gui/library/ui/StackViewNavController.ui
        Gui/ui/About.ui
        Gui/ui/ClipProperty.ui
273
        Gui/ui/IntroDialog.ui
274
        Gui/ui/MainWindow.ui
275
        Gui/media/ui/ClipMetadataDisplayer.ui
276
277
278
279
280
        Gui/preview/ui/PreviewWidget.ui
        Gui/import/ui/TagWidget.ui
        Gui/ui/Timeline.ui
        Gui/ui/WorkflowFileRendererDialog.ui
        Gui/widgets/TrackControls.ui
281
        Gui/widgets/ui/NotificationZone.ui
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
        Gui/wizard/ui/GeneralPage.ui
        Gui/wizard/ui/OpenPage.ui
        Gui/wizard/ui/VideoPage.ui
        Gui/wizard/ui/WelcomePage.ui
        )

    IF (WITH_CRASHHANDLER_GUI)
        LIST( APPEND VLMC_SRCS Gui/widgets/CrashHandler.cpp )
        IF ( CMAKE_SYSTEM_NAME STREQUAL "Linux" )
            LIST( APPEND VLMC_SRCS Tools/UnixBacktraceGenerator.cpp )
        ELSE ( CMAKE_SYSTEM_NAME STREQUAL "Linux" )
            LIST( APPEND VLMC_SRCS Tools/Win32BacktraceGenerator.cpp )
        ENDIF( CMAKE_SYSTEM_NAME STREQUAL "Linux" )
        LIST( APPEND VLMC_HDRS Gui/widgets/CrashHandler.h )
        LIST( APPEND VLMC_UIS Gui/widgets/CrashHandler.ui )
    ENDIF(WITH_CRASHHANDLER_GUI)

    QT4_WRAP_UI(VLMC_UIS_H ${VLMC_UIS})
    QT4_ADD_RESOURCES(VLMC_RCC_SRCS ${VLMC_RCC})
    QT4_WRAP_CPP(VLMC_MOC_SRCS ${VLMC_HDRS})

Rohit Yadav's avatar
Rohit Yadav committed
303
    IF( MINGW )
304
305
306
307
308
309
        # resource compilation for MinGW
        ADD_CUSTOM_COMMAND( OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/icon.o
            COMMAND ${CMAKE_WINDRES} -I${CMAKE_SOURCE_DIR} -i${CMAKE_SOURCE_DIR}/cmake/icon.rc
            -o ${CMAKE_CURRENT_BINARY_DIR}/icon.o )
        SET(VLMC_SRCS ${VLMC_SRCS} ${CMAKE_CURRENT_BINARY_DIR}/icon.o)
        SET(LINK_FLAGS -Wl,-subsystem,windows)
Rohit Yadav's avatar
Rohit Yadav committed
310
    ENDIF( MINGW )
311

Rohit Yadav's avatar
Rohit Yadav committed
312
    IF( WIN32 )
313
314
315
        SET( GUI_TYPE WIN32 )
    ENDIF( WIN32 )

Rohit Yadav's avatar
Rohit Yadav committed
316
317
318
319
320
321
322
323
324
    IF( APPLE )
        SET( GUI_TYPE MACOSX_BUNDLE )
        SET(VLMC_SRCS ${VLMC_SRCS} ../share/VLMC.icns)
        SET_SOURCE_FILES_PROPERTIES(../share/VLMC.icns PROPERTIES
            MACOSX_PACKAGE_LOCATION Resources)
        SET(MACOSX_BUNDLE_ICON_FILE VLMC.icns)
    ENDIF( APPLE )

    ADD_EXECUTABLE( vlmc ${GUI_TYPE} ${VLMC_SRCS} ${VLMC_MOC_SRCS} ${VLMC_UIS_H} ${VLMC_RCC_SRCS} )
325
326
327
328
329
330
331
332
333
    TARGET_LINK_LIBRARIES(vlmc
      ${QT_QTCORE_LIBRARY} 
      ${QT_QTGUI_LIBRARY} 
      ${QT_QTXML_LIBRARY} 
      ${QT_QTSVG_LIBRARY} 
      ${LIBVLC_LIBRARY}
      ${LIBVLCCORE_LIBRARY}
      )

Rohit Yadav's avatar
Rohit Yadav committed
334
ENDIF( NOT WITH_GUI )
335

Rohit Yadav's avatar
Rohit Yadav committed
336
ADD_DEPENDENCIES( vlmc translations )
Ludovic Fauvet's avatar
Ludovic Fauvet committed
337

Rohit Yadav's avatar
Rohit Yadav committed
338
339
340
INSTALL(TARGETS vlmc 
        BUNDLE  DESTINATION ${VLMC_BIN_DIR}
        RUNTIME DESTINATION ${VLMC_BIN_DIR})
Ludovic Fauvet's avatar
Ludovic Fauvet committed
341

342
343
344
345
346
ADD_CUSTOM_COMMAND(
    OUTPUT ${CMAKE_SOURCE_DIR}/bin/vlmc
    COMMAND ${CMAKE_COMMAND} copy ${CMAKE_CURRENT_SOURCE_DIR}/vlmc ${CMAKE_SOURCE_DIR}/bin/vlmc
    DEPENDS ${CMAKE_BINARY_DIR}/src/vlmc
)
Ludovic Fauvet's avatar
Ludovic Fauvet committed
347

348
349
ADD_DEFINITIONS( -W -Wall )

350
351
352
353
354
355
IF(UNIX)
    IF (WITH_PROFILING)
        ADD_DEFINITIONS( -pg )
        SET_TARGET_PROPERTIES( vlmc PROPERTIES LINK_FLAGS -pg )
    ENDIF(WITH_PROFILING)
ENDIF(UNIX)
Ludovic Fauvet's avatar
Ludovic Fauvet committed
356

Rohit Yadav's avatar
Rohit Yadav committed
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
IF( APPLE )
    ADD_CUSTOM_COMMAND(
        TARGET vlmc
        POST_BUILD
        COMMAND cp -r ${CMAKE_SOURCE_DIR}/contribs/* ${CMAKE_CURRENT_BINARY_DIR}/../bin/vlmc.app/Contents/MacOS
    )

    ADD_CUSTOM_COMMAND(
        TARGET vlmc
        POST_BUILD
        COMMAND macdeployqt ${CMAKE_CURRENT_BINARY_DIR}/../bin/vlmc.app -no-plugins #-dmg
        WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
        COMMENT "Deploying the Qt Framework onto the bundle"
    )
ENDIF( APPLE )