CMakeLists.txt 12.5 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 46
    Tools/QSingleton.hpp
    Tools/Singleton.hpp
    Tools/Toggleable.hpp
    Tools/VlmcDebug.cpp
    Tools/WaitCondition.hpp
    Workflow/AudioClipWorkflow.cpp 
    Workflow/ClipWorkflow.cpp
47
    Workflow/ClipHelper.cpp
48
    Workflow/Helper.cpp
Ludovic Fauvet's avatar
Ludovic Fauvet committed
49 50 51 52
    Workflow/ImageClipWorkflow.cpp
    Workflow/MainWorkflow.cpp
    Workflow/TrackHandler.cpp
    Workflow/TrackWorkflow.cpp
53
    Workflow/Types.cpp
Ludovic Fauvet's avatar
Ludovic Fauvet committed
54 55 56
    Workflow/VideoClipWorkflow.cpp
  )

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

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

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

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

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

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

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

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

224
    LIST( APPEND VLMC_MOC_HDRS
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/project/GuiProjectManager.h
255
        Gui/settings/BoolWidget.h
256
        Gui/settings/ColorWidget.h
257
        Gui/settings/DoubleWidget.h
258
        Gui/settings/DoubleSliderWidget.h
259
        Gui/settings/ISettingsCategoryWidget.h
260 261 262
        Gui/settings/IntWidget.h
        Gui/settings/KeyboardShortcut.h
        Gui/settings/KeyboardShortcutInput.h
263
        Gui/settings/LanguageWidget.h
264
        Gui/settings/Panel.h
265
        Gui/settings/PathWidget.h
266
        Gui/settings/PreferenceWidget.h
267 268
        Gui/settings/PreferenceWidget.h
        Gui/settings/Settings.h
269
        Gui/settings/StringWidget.h
270
        Gui/timeline/AbstractGraphicsItem.h
271
        Gui/timeline/AbstractGraphicsMediaItem.h
272
        Gui/timeline/GraphicsEffectItem.h
273 274 275 276 277 278 279
        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
280
        Gui/widgets/ExtendedLabel.h
281
        Gui/widgets/FramelessButton.h
282
        Gui/widgets/NotificationZone.h
283
        Gui/widgets/SearchLineEdit.h
284 285 286 287 288 289
        Gui/widgets/TrackControls.h
        Gui/wizard/GeneralPage.h
        Gui/wizard/OpenPage.h
        Gui/wizard/ProjectWizard.h
        Gui/wizard/VideoPage.h
        Gui/wizard/WelcomePage.h
290
        Media/Transcoder.h #Won't be needed without the import, so let's put it in GUI list
291 292 293
        )
     
    SET(VLMC_UIS
294
        Gui/effectsengine/ui/EffectInstanceWidget.ui
295
        Gui/effectsengine/ui/EffectStack.ui
296
        Gui/effectsengine/ui/EffectWidget.ui
297
        Gui/export/RendererSettings.ui
298
        Gui/export/ShareOnInternet.ui
299
        Gui/import/ui/ImportController.ui
300
        Gui/import/ui/TagWidget.ui
301 302
        Gui/library/StackViewNavController.ui
        Gui/library/ui/MediaCellView.ui
303
        Gui/library/ui/MediaLibrary.ui
304
        Gui/library/ui/StackViewNavController.ui
305 306
        Gui/media/ui/ClipMetadataDisplayer.ui
        Gui/preview/ui/PreviewWidget.ui
307 308
        Gui/ui/About.ui
        Gui/ui/ClipProperty.ui
309
        Gui/ui/IntroDialog.ui
310 311 312
        Gui/ui/MainWindow.ui
        Gui/ui/Timeline.ui
        Gui/ui/WorkflowFileRendererDialog.ui
313
        Gui/widgets/ui/TrackControls.ui
314
        Gui/widgets/ui/NotificationZone.ui
315 316 317 318 319 320 321 322 323 324 325 326 327
        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" )
328
        LIST( APPEND VLMC_MOC_HDRS Gui/widgets/CrashHandler.h )
329
        LIST( APPEND VLMC_UIS Gui/widgets/ui/CrashHandler.ui )
330 331 332 333
    ENDIF(WITH_CRASHHANDLER_GUI)

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

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

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

353 354 355 356 357 358 359 360 361
    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} )
362
    TARGET_LINK_LIBRARIES( vlmc ${VLMC_LIBS} )
363

364
ENDIF( NOT WITH_GUI )
365

366
ADD_DEPENDENCIES( vlmc translations )
Ludovic Fauvet's avatar
Ludovic Fauvet committed
367

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

372 373 374 375 376
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
377

378 379
ADD_DEFINITIONS( -W -Wall )

380 381 382 383 384 385
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
386

387 388 389 390 391 392 393 394 395 396 397 398 399 400 401
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 )