CMakeLists.txt 12.7 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
    EffectsEngine/EffectsEngine.cpp
    EffectsEngine/Effect.cpp
11
    EffectsEngine/EffectUser.cpp
12
    EffectsEngine/EffectHelper.cpp
13
    EffectsEngine/EffectInstance.cpp
14
    EffectsEngine/EffectSettingValue.cpp
Ludovic Fauvet's avatar
Ludovic Fauvet committed
15
    Library/Library.cpp
16
    Library/MediaContainer.cpp
Ludovic Fauvet's avatar
Ludovic Fauvet committed
17 18 19 20 21 22 23 24 25
    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
26 27
    Project/Workspace.cpp
    Project/WorkspaceWorker.cpp
Ludovic Fauvet's avatar
Ludovic Fauvet committed
28
    Renderer/ClipRenderer.cpp
29
    Renderer/GenericRenderer.cpp
Ludovic Fauvet's avatar
Ludovic Fauvet committed
30 31
    Renderer/WorkflowFileRenderer.cpp
    Renderer/WorkflowRenderer.cpp
32 33 34 35 36
    Services/UploaderIODevice.cpp
    Services/YouTube/YouTubeAuthenticator.cpp
    Services/YouTube/YouTubeFeedParser.cpp
    Services/YouTube/YouTubeService.cpp
    Services/YouTube/YouTubeUploader.cpp
37 38
    Settings/SettingsManager.cpp
    Settings/SettingValue.cpp
39
    Tools/ErrorHandler.cpp
Ludovic Fauvet's avatar
Ludovic Fauvet committed
40 41 42 43 44 45
    Tools/QSingleton.hpp
    Tools/Singleton.hpp
    Tools/Toggleable.hpp
    Tools/VlmcDebug.cpp
    Workflow/AudioClipWorkflow.cpp 
    Workflow/ClipWorkflow.cpp
46
    Workflow/ClipHelper.cpp
47
    Workflow/Helper.cpp
Ludovic Fauvet's avatar
Ludovic Fauvet committed
48 49 50 51
    Workflow/ImageClipWorkflow.cpp
    Workflow/MainWorkflow.cpp
    Workflow/TrackHandler.cpp
    Workflow/TrackWorkflow.cpp
52
    Workflow/Types.cpp
Ludovic Fauvet's avatar
Ludovic Fauvet committed
53 54 55
    Workflow/VideoClipWorkflow.cpp
  )

56
IF (WIN32)
Hugo Beauzee-Luyssen's avatar
Hugo Beauzee-Luyssen committed
57
    LIST ( APPEND VLMC_SRCS Main/winvlmc.cpp )
58
ELSE (WIN32)
59
    LIST( APPEND VLMC_SRCS Main/vlmc.cpp )
60 61
ENDIF(WIN32)

62
SET (VLMC_MOC_HDRS
63
    EffectsEngine/EffectHelper.h
64
    EffectsEngine/EffectUser.h
65
    EffectsEngine/EffectsEngine.h
66
    EffectsEngine/EffectSettingValue.h
Ludovic Fauvet's avatar
Ludovic Fauvet committed
67
    Library/Library.h
68
    Library/MediaContainer.h
69
    LibVLCpp/VLCInstance.h
Ludovic Fauvet's avatar
Ludovic Fauvet committed
70 71 72 73 74 75
    LibVLCpp/VLCMediaPlayer.h
    Media/Clip.h
    Media/Media.h
    Metadata/MetaDataManager.h
    Metadata/MetaDataWorker.h
    Project/ProjectManager.h
76 77
    Project/Workspace.h
    Project/WorkspaceWorker.h
Ludovic Fauvet's avatar
Ludovic Fauvet committed
78 79 80 81
    Renderer/ClipRenderer.h
    Renderer/GenericRenderer.h
    Renderer/WorkflowFileRenderer.h
    Renderer/WorkflowRenderer.h
82 83 84 85 86
    Services/AbstractSharingService.h
    Services/UploaderIODevice.h
    Services/YouTube/YouTubeAuthenticator.h
    Services/YouTube/YouTubeService.h
    Services/YouTube/YouTubeUploader.h
87 88
    Settings/SettingsManager.h
    Settings/SettingValue.h
Ludovic Fauvet's avatar
Ludovic Fauvet committed
89
    Tools/VlmcDebug.h
Ludovic Fauvet's avatar
Ludovic Fauvet committed
90
    Workflow/AudioClipWorkflow.h 
Ludovic Fauvet's avatar
Ludovic Fauvet committed
91
    Workflow/ClipWorkflow.h
92
    Workflow/ClipHelper.h
93
    Workflow/Helper.h
Ludovic Fauvet's avatar
Ludovic Fauvet committed
94
    Workflow/ImageClipWorkflow.h
Ludovic Fauvet's avatar
Ludovic Fauvet committed
95 96 97
    Workflow/MainWorkflow.h
    Workflow/TrackHandler.h
    Workflow/TrackWorkflow.h
Ludovic Fauvet's avatar
Ludovic Fauvet committed
98
    Workflow/VideoClipWorkflow.h
Ludovic Fauvet's avatar
Ludovic Fauvet committed
99 100 101
  )

SET(VLMC_RCC
102 103
    ../resources.qrc
    ../ts/resources-ts.qrc
Ludovic Fauvet's avatar
Ludovic Fauvet committed
104 105
  )

106 107 108 109
IF (WIN32)
    LIST( APPEND VLMC_RCC ../resources/styles.qrc )
ENDIF (WIN32)

Ludovic Fauvet's avatar
Ludovic Fauvet committed
110 111 112 113 114 115
#include paths for vlmc
INCLUDE_DIRECTORIES(
  ${CMAKE_CURRENT_BINARY_DIR}
  ${CMAKE_CURRENT_BINARY_DIR}/src
  .
  Commands
116
  EffectsEngine
117
  Settings 
Ludovic Fauvet's avatar
Ludovic Fauvet committed
118
  Gui
119
  Gui/effectsengine
Ludovic Fauvet's avatar
Ludovic Fauvet committed
120 121
  Gui/import
  Gui/library
122
  Gui/media
123
  Gui/preview
Ludovic Fauvet's avatar
Ludovic Fauvet committed
124 125 126 127 128 129 130 131 132 133
  Gui/settings
  Gui/timeline
  Gui/widgets
  Gui/wizard
  Library
  LibVLCpp
  Media
  Metadata
  Project
  Renderer
134 135
  Services
  Services/YouTube
Ludovic Fauvet's avatar
Ludovic Fauvet committed
136 137 138 139
  Tools
  Workflow
)

140 141
CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/cmake/config.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config.h)

142
IF (NOT WITH_GUI)
143
    LIST (APPEND VLMC_SRCS Main/main.cpp Renderer/ConsoleRenderer.cpp )
144
    LIST (APPEND VLMC_MOC_HDRS Renderer/ConsoleRenderer.h)
145
    QT4_ADD_RESOURCES(VLMC_RCC_SRCS ${VLMC_RCC})
146
    QT4_WRAP_CPP(VLMC_MOC_SRCS ${VLMC_MOC_HDRS})
147
    ADD_EXECUTABLE(vlmc ${GUI_TYPE} ${VLMC_SRCS} ${VLMC_MOC_SRCS} ${VLMC_RCC_SRCS})
148
    TARGET_LINK_LIBRARIES(vlmc ${VLMC_LIBS})
Ludovic Fauvet's avatar
Ludovic Fauvet committed
149

150
#Add GUI stuff if required
151 152
ELSE(NOT WITH_GUI)
     LIST( APPEND VLMC_SRCS
153
        Commands/KeyboardShortcutHelper.cpp
154 155 156 157
        Gui/About.cpp
        Gui/AudioSpectrumDrawer.cpp
        Gui/ClipProperty.cpp
        Gui/DockWidgetManager.cpp
158
        Gui/IntroDialog.cpp
159 160 161 162
        Gui/LanguageHelper.cpp
        Gui/MainWindow.cpp
        Gui/UndoStack.cpp
        Gui/WorkflowFileRendererDialog.cpp
163
        Gui/effectsengine/EffectInstanceWidget.cpp
164
        Gui/effectsengine/EffectInstanceListModel.cpp
165
        Gui/effectsengine/EffectsListView.cpp
166
        Gui/effectsengine/EffectStack.cpp
167
        Gui/effectsengine/EffectWidget.cpp
168
        Gui/export/RendererSettings.cpp
169
        Gui/export/ShareOnInternet.cpp
170
        Gui/import/ImportController.cpp
171
        Gui/import/TagWidget.cpp
172 173
        Gui/library/ListViewController.cpp
        Gui/library/MediaCellView.cpp
174
        Gui/library/MediaLibrary.cpp
175 176 177
        Gui/library/MediaListView.cpp
        Gui/library/StackViewController.cpp
        Gui/library/StackViewNavController.cpp
178
        Gui/media/ClipMetadataDisplayer.cpp
179 180
        Gui/media/GuiMedia.cpp
        Gui/preview/LCDTimecode.cpp
181 182
        Gui/preview/PreviewRuler.cpp
        Gui/preview/PreviewWidget.cpp
183
        Gui/project/GuiProjectManager.cpp
184
        Gui/settings/BoolWidget.cpp
185
        Gui/settings/ColorWidget.cpp
186
        Gui/settings/DoubleWidget.cpp
187
        Gui/settings/DoubleSliderWidget.cpp
188 189 190 191 192
        Gui/settings/IntWidget.cpp
        Gui/settings/KeyboardShortcut.cpp
        Gui/settings/KeyboardShortcutInput.cpp
        Gui/settings/LanguageWidget.cpp
        Gui/settings/Panel.cpp
193
        Gui/settings/PathWidget.cpp
194 195 196
        Gui/settings/PreferenceWidget.cpp
        Gui/settings/Settings.cpp
        Gui/settings/StringWidget.cpp
197
        Gui/timeline/AbstractGraphicsItem.cpp
198 199 200
        Gui/timeline/AbstractGraphicsMediaItem.cpp
        Gui/timeline/GraphicsAudioItem.cpp
        Gui/timeline/GraphicsCursorItem.cpp
201
        Gui/timeline/GraphicsEffectItem.cpp
202 203 204 205 206 207 208
        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
209
        Gui/widgets/ExtendedLabel.cpp
210
        Gui/widgets/FramelessButton.cpp
211
        Gui/widgets/NotificationZone.cpp
212
        Gui/widgets/SearchLineEdit.cpp
213 214 215 216 217 218
        Gui/widgets/TrackControls.cpp
        Gui/wizard/GeneralPage.cpp
        Gui/wizard/OpenPage.cpp
        Gui/wizard/ProjectWizard.cpp
        Gui/wizard/VideoPage.cpp
        Gui/wizard/WelcomePage.cpp
219 220
        Main/guimain.cpp
        Media/Transcoder.cpp #Won't be needed without the import, so let's put it in GUI list
221 222
        )

223
    LIST( APPEND VLMC_MOC_HDRS
224
        Commands/Commands.h
225
        Commands/KeyboardShortcutHelper.h
226 227 228
        Gui/About.h
        Gui/ClipProperty.h
        Gui/DockWidgetManager.h
229 230 231 232 233
        Gui/IntroDialog.h
        Gui/LanguageHelper.h
        Gui/MainWindow.h
        Gui/UndoStack.h
        Gui/WorkflowFileRendererDialog.h
234
        Gui/effectsengine/EffectInstanceWidget.h
235
        Gui/effectsengine/EffectsListView.h
236
        Gui/effectsengine/EffectStack.h
237
        Gui/effectsengine/EffectWidget.h
238
        Gui/export/RendererSettings.h
239
        Gui/export/ShareOnInternet.h
240
        Gui/import/ImportController.h
241
        Gui/import/TagWidget.h
242 243
        Gui/library/ListViewController.h
        Gui/library/MediaCellView.h
244
        Gui/library/MediaLibrary.h
245 246 247 248
        Gui/library/MediaListView.h
        Gui/library/StackViewController.h
        Gui/library/StackViewNavController.h
        Gui/library/ViewController.h
249
        Gui/media/ClipMetadataDisplayer.h
250
        Gui/media/GuiMedia.h
251
        Gui/preview/LCDTimecode.h
252 253
        Gui/preview/PreviewRuler.h
        Gui/preview/PreviewWidget.h
254
        Gui/preview/RenderWidget.h
255
        Gui/project/GuiProjectManager.h
256
        Gui/settings/BoolWidget.h
257
        Gui/settings/ColorWidget.h
258
        Gui/settings/DoubleWidget.h
259
        Gui/settings/DoubleSliderWidget.h
260
        Gui/settings/ISettingsCategoryWidget.h
261 262 263
        Gui/settings/IntWidget.h
        Gui/settings/KeyboardShortcut.h
        Gui/settings/KeyboardShortcutInput.h
264
        Gui/settings/LanguageWidget.h
265
        Gui/settings/Panel.h
266
        Gui/settings/PathWidget.h
267
        Gui/settings/PreferenceWidget.h
268
        Gui/settings/Settings.h
269
        Gui/settings/StringWidget.h
270
        Gui/timeline/AbstractGraphicsItem.h
271
        Gui/timeline/AbstractGraphicsMediaItem.h
272
		Gui/timeline/GraphicsAudioItem.h
273
        Gui/timeline/GraphicsEffectItem.h
274
		Gui/timeline/GraphicsMovieItem.h
275 276 277 278 279 280 281
        Gui/timeline/GraphicsCursorItem.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
282
        Gui/widgets/ExtendedLabel.h
283
        Gui/widgets/FramelessButton.h
284
        Gui/widgets/NotificationZone.h
285
        Gui/widgets/SearchLineEdit.h
286 287 288 289 290 291
        Gui/widgets/TrackControls.h
        Gui/wizard/GeneralPage.h
        Gui/wizard/OpenPage.h
        Gui/wizard/ProjectWizard.h
        Gui/wizard/VideoPage.h
        Gui/wizard/WelcomePage.h
292
        Media/Transcoder.h #Won't be needed without the import, so let's put it in GUI list
293 294 295
        )
     
    SET(VLMC_UIS
296
        Gui/effectsengine/ui/EffectInstanceWidget.ui
297
        Gui/effectsengine/ui/EffectStack.ui
298
        Gui/effectsengine/ui/EffectWidget.ui
299
        Gui/export/RendererSettings.ui
300
        Gui/export/ShareOnInternet.ui
301
        Gui/import/ui/ImportController.ui
302
        Gui/import/ui/TagWidget.ui
303
        Gui/library/ui/MediaCellView.ui
304
        Gui/library/ui/MediaLibrary.ui
305
        Gui/library/ui/StackViewNavController.ui
306 307
        Gui/media/ui/ClipMetadataDisplayer.ui
        Gui/preview/ui/PreviewWidget.ui
308 309
        Gui/ui/About.ui
        Gui/ui/ClipProperty.ui
310
        Gui/ui/IntroDialog.ui
311 312 313
        Gui/ui/MainWindow.ui
        Gui/ui/Timeline.ui
        Gui/ui/WorkflowFileRendererDialog.ui
314
        Gui/widgets/ui/TrackControls.ui
315
        Gui/widgets/ui/NotificationZone.ui
316 317 318 319 320 321 322 323 324 325 326 327 328
        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" )
329
        LIST( APPEND VLMC_MOC_HDRS Gui/widgets/CrashHandler.h )
330
        LIST( APPEND VLMC_UIS Gui/widgets/ui/CrashHandler.ui )
331 332 333 334
    ENDIF(WITH_CRASHHANDLER_GUI)

    QT4_WRAP_UI(VLMC_UIS_H ${VLMC_UIS})
    QT4_ADD_RESOURCES(VLMC_RCC_SRCS ${VLMC_RCC})
335
    QT4_WRAP_CPP(VLMC_MOC_SRCS ${VLMC_MOC_HDRS})
336 337 338 339
    
    #Handle non-MOC headers:
    LIST( APPEND VLMC_HDRS ${VLMC_MOC_HDRS}
        )
340

341
    IF( MINGW )
342 343 344 345 346 347
        # 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)
348
    ENDIF( MINGW )
349

350
    IF( WIN32 )
351 352 353
        SET( GUI_TYPE WIN32 )
    ENDIF( WIN32 )

354 355 356 357 358 359
    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)
360
        LIST( APPEND VLMC_SRCS Gui/preview/RenderWidget.mm )
361 362 363
    ENDIF( APPLE )

    ADD_EXECUTABLE( vlmc ${GUI_TYPE} ${VLMC_SRCS} ${VLMC_MOC_SRCS} ${VLMC_UIS_H} ${VLMC_RCC_SRCS} )
364
    TARGET_LINK_LIBRARIES( vlmc ${VLMC_LIBS} )
365

366
ENDIF( NOT WITH_GUI )
367

368
ADD_DEPENDENCIES( vlmc translations )
Ludovic Fauvet's avatar
Ludovic Fauvet committed
369

370 371 372
INSTALL(TARGETS vlmc 
        BUNDLE  DESTINATION ${VLMC_BIN_DIR}
        RUNTIME DESTINATION ${VLMC_BIN_DIR})
Ludovic Fauvet's avatar
Ludovic Fauvet committed
373

374 375 376 377 378
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
379

380 381
ADD_DEFINITIONS( -W -Wall )

382 383 384 385 386 387
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
388

389
IF( APPLE )
Rohit Yadav's avatar
Rohit Yadav committed
390
    SET(CONTRIBS_DIR ${CMAKE_SOURCE_DIR}/contribs/)
391 392 393
    ADD_CUSTOM_COMMAND(
        TARGET vlmc
        POST_BUILD
394
        COMMAND cp -r ${CONTRIBS_DIR}/include ${CONTRIBS_DIR}/lib ${CONTRIBS_DIR}/plugins ${CONTRIBS_DIR}/effects ${CONTRIBS_DIR}/ts ${CMAKE_CURRENT_BINARY_DIR}/../bin/vlmc.app/Contents/MacOS
395 396 397 398 399 400 401 402 403
    )
    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 )