CMakeLists.txt 9.91 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 11 12 13 14 15 16 17 18 19 20 21
    Backend/IBackend.h
    Backend/ISourceRenderer.h
    Backend/ISource.h
    Backend/VLC/EventWaiter.cpp
    Backend/VLC/VLCBackend.cpp
    Backend/VLC/VLCSourceRenderer.cpp
    Backend/VLC/VLCVmemRenderer.cpp
    Backend/VLC/VLCSource.cpp
    Backend/VLC/VLCMemorySource.cpp
    Backend/VLC/LibVLCpp/VLCInstance.cpp
    Backend/VLC/LibVLCpp/VLCMedia.cpp
    Backend/VLC/LibVLCpp/VLCMediaPlayer.cpp
    Backend/VLC/LibVLCpp/VLCpp.hpp
22 23
    EffectsEngine/EffectsEngine.cpp
    EffectsEngine/Effect.cpp
24
    EffectsEngine/EffectUser.cpp
25
    EffectsEngine/EffectHelper.cpp
26
    EffectsEngine/EffectInstance.cpp
27
    EffectsEngine/EffectSettingValue.cpp
Ludovic Fauvet's avatar
Ludovic Fauvet committed
28
    Library/Library.cpp
29
    Library/MediaContainer.cpp
Ludovic Fauvet's avatar
Ludovic Fauvet committed
30 31 32 33
    Media/Clip.cpp
    Media/Media.cpp
    Metadata/MetaDataManager.cpp
    Project/ProjectManager.cpp
34 35
    Project/Workspace.cpp
    Project/WorkspaceWorker.cpp
Ludovic Fauvet's avatar
Ludovic Fauvet committed
36
    Renderer/ClipRenderer.cpp
37
    Renderer/GenericRenderer.cpp
Ludovic Fauvet's avatar
Ludovic Fauvet committed
38 39
    Renderer/WorkflowFileRenderer.cpp
    Renderer/WorkflowRenderer.cpp
40
    Services/AbstractSharingService.h
41 42 43 44 45
    Services/UploaderIODevice.cpp
    Services/YouTube/YouTubeAuthenticator.cpp
    Services/YouTube/YouTubeFeedParser.cpp
    Services/YouTube/YouTubeService.cpp
    Services/YouTube/YouTubeUploader.cpp
46 47
    Settings/SettingsManager.cpp
    Settings/SettingValue.cpp
48
    Tools/ErrorHandler.cpp
49
    Tools/MemoryPool.hpp
Ludovic Fauvet's avatar
Ludovic Fauvet committed
50
    Tools/QSingleton.hpp
51
    Tools/RendererEventWatcher.cpp
Ludovic Fauvet's avatar
Ludovic Fauvet committed
52 53
    Tools/Singleton.hpp
    Tools/Toggleable.hpp
54 55
    Tools/VlmcDebug.h
    Tools/VlmcLogger.cpp
56
    Workflow/AudioClipWorkflow.cpp
Ludovic Fauvet's avatar
Ludovic Fauvet committed
57
    Workflow/ClipWorkflow.cpp
58
    Workflow/ClipHelper.cpp
59
    Workflow/Helper.cpp
Ludovic Fauvet's avatar
Ludovic Fauvet committed
60 61 62 63
    Workflow/ImageClipWorkflow.cpp
    Workflow/MainWorkflow.cpp
    Workflow/TrackHandler.cpp
    Workflow/TrackWorkflow.cpp
64
    Workflow/Types.cpp
Ludovic Fauvet's avatar
Ludovic Fauvet committed
65 66 67
    Workflow/VideoClipWorkflow.cpp
  )

68
IF (WIN32)
Hugo Beauzee-Luyssen's avatar
Hugo Beauzee-Luyssen committed
69
    LIST ( APPEND VLMC_SRCS Main/winvlmc.cpp )
70
ELSE (WIN32)
71
    LIST( APPEND VLMC_SRCS Main/vlmc.cpp )
72 73
ENDIF(WIN32)

Ludovic Fauvet's avatar
Ludovic Fauvet committed
74
SET(VLMC_RCC
75 76
    ../resources.qrc
    ../ts/resources-ts.qrc
Ludovic Fauvet's avatar
Ludovic Fauvet committed
77 78
  )

79 80 81 82
IF (WIN32)
    LIST( APPEND VLMC_RCC ../resources/styles.qrc )
ENDIF (WIN32)

Ludovic Fauvet's avatar
Ludovic Fauvet committed
83 84 85 86 87
#include paths for vlmc
INCLUDE_DIRECTORIES(
  ${CMAKE_CURRENT_BINARY_DIR}
  ${CMAKE_CURRENT_BINARY_DIR}/src
  .
88
  Backend/VLC/LibVLCpp
Ludovic Fauvet's avatar
Ludovic Fauvet committed
89
  Gui
90
  Gui/effectsengine
Ludovic Fauvet's avatar
Ludovic Fauvet committed
91
  Gui/library
92
  Gui/media
93
  Gui/preview
Ludovic Fauvet's avatar
Ludovic Fauvet committed
94 95 96
  Gui/timeline
)

97 98
CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/cmake/config.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config.h)

99
IF (NOT WITH_GUI)
100
    LIST (APPEND VLMC_SRCS Main/main.cpp Renderer/ConsoleRenderer.cpp )
101
    QT_ADD_RESOURCES(VLMC_RCC_SRCS ${VLMC_RCC})
102
    ADD_EXECUTABLE(vlmc ${GUI_TYPE} ${VLMC_SRCS} ${VLMC_MOC_SRCS} ${VLMC_RCC_SRCS})
103
    qt_use_modules(vlmc Core Xml Network)
104
    TARGET_LINK_LIBRARIES(vlmc ${VLMC_LIBS})
Ludovic Fauvet's avatar
Ludovic Fauvet committed
105

106
#Add GUI stuff if required
107 108
ELSE(NOT WITH_GUI)
     LIST( APPEND VLMC_SRCS
109
        Commands/KeyboardShortcutHelper.cpp
110 111 112 113
        Gui/About.cpp
        Gui/AudioSpectrumDrawer.cpp
        Gui/ClipProperty.cpp
        Gui/DockWidgetManager.cpp
114
        Gui/IntroDialog.cpp
115 116 117 118
        Gui/LanguageHelper.cpp
        Gui/MainWindow.cpp
        Gui/UndoStack.cpp
        Gui/WorkflowFileRendererDialog.cpp
119
        Gui/effectsengine/EffectInstanceWidget.cpp
120
        Gui/effectsengine/EffectInstanceListModel.cpp
121
        Gui/effectsengine/EffectsListView.cpp
122
        Gui/effectsengine/EffectStack.cpp
123
        Gui/effectsengine/EffectWidget.cpp
124
        Gui/export/RendererSettings.cpp
125
        Gui/export/ShareOnInternet.cpp
126
        Gui/import/ImportController.cpp
127
        Gui/import/TagWidget.cpp
128 129
        Gui/library/ListViewController.cpp
        Gui/library/MediaCellView.cpp
130
        Gui/library/MediaLibrary.cpp
131 132 133
        Gui/library/MediaListView.cpp
        Gui/library/StackViewController.cpp
        Gui/library/StackViewNavController.cpp
134
        Gui/library/ViewController.h
135
        Gui/media/ClipMetadataDisplayer.cpp
136
        Gui/preview/LCDTimecode.cpp
137 138
        Gui/preview/PreviewRuler.cpp
        Gui/preview/PreviewWidget.cpp
139
        Gui/project/GuiProjectManager.cpp
140
        Gui/settings/BoolWidget.cpp
141
        Gui/settings/ColorWidget.cpp
142
        Gui/settings/DoubleWidget.cpp
143
        Gui/settings/DoubleSliderWidget.cpp
144
        Gui/settings/IntWidget.cpp
145
        Gui/settings/ISettingsCategoryWidget.h
146 147 148 149
        Gui/settings/KeyboardShortcut.cpp
        Gui/settings/KeyboardShortcutInput.cpp
        Gui/settings/LanguageWidget.cpp
        Gui/settings/Panel.cpp
150
        Gui/settings/PathWidget.cpp
151 152 153
        Gui/settings/PreferenceWidget.cpp
        Gui/settings/Settings.cpp
        Gui/settings/StringWidget.cpp
154
        Gui/timeline/AbstractGraphicsItem.cpp
155 156 157
        Gui/timeline/AbstractGraphicsMediaItem.cpp
        Gui/timeline/GraphicsAudioItem.cpp
        Gui/timeline/GraphicsCursorItem.cpp
158
        Gui/timeline/GraphicsEffectItem.cpp
159 160 161 162 163 164 165
        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
166
        Gui/widgets/ExtendedLabel.cpp
167
        Gui/widgets/FramelessButton.cpp
168
        Gui/widgets/NotificationZone.cpp
169
        Gui/widgets/SearchLineEdit.cpp
170 171 172 173 174 175
        Gui/widgets/TrackControls.cpp
        Gui/wizard/GeneralPage.cpp
        Gui/wizard/OpenPage.cpp
        Gui/wizard/ProjectWizard.cpp
        Gui/wizard/VideoPage.cpp
        Gui/wizard/WelcomePage.cpp
176 177
        Main/guimain.cpp
        Media/Transcoder.cpp #Won't be needed without the import, so let's put it in GUI list
178 179 180
        )

    SET(VLMC_UIS
181
        Gui/effectsengine/ui/EffectInstanceWidget.ui
182
        Gui/effectsengine/ui/EffectStack.ui
183
        Gui/effectsengine/ui/EffectWidget.ui
184
        Gui/export/RendererSettings.ui
185
        Gui/export/ShareOnInternet.ui
186
        Gui/import/ui/ImportController.ui
187
        Gui/import/ui/TagWidget.ui
188
        Gui/library/ui/MediaCellView.ui
189
        Gui/library/ui/MediaLibrary.ui
190
        Gui/library/ui/StackViewNavController.ui
191 192
        Gui/media/ui/ClipMetadataDisplayer.ui
        Gui/preview/ui/PreviewWidget.ui
193 194
        Gui/ui/About.ui
        Gui/ui/ClipProperty.ui
195
        Gui/ui/IntroDialog.ui
196 197 198
        Gui/ui/MainWindow.ui
        Gui/ui/Timeline.ui
        Gui/ui/WorkflowFileRendererDialog.ui
199
        Gui/widgets/ui/TrackControls.ui
200
        Gui/widgets/ui/NotificationZone.ui
201 202 203 204 205 206 207 208 209 210 211 212 213
        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" )
214
        LIST( APPEND Gui/widgets/CrashHandler.h )
215
        LIST( APPEND VLMC_UIS Gui/widgets/ui/CrashHandler.ui )
216 217
    ENDIF(WITH_CRASHHANDLER_GUI)

218 219
    QT_WRAP_UI(VLMC_UIS_H ${VLMC_UIS})
    QT_ADD_RESOURCES(VLMC_RCC_SRCS ${VLMC_RCC})
220

221
    IF( MINGW )
222 223 224 225 226 227
        # 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)
228
    ENDIF( MINGW )
229

230
    IF( WIN32 )
231 232 233
        SET( GUI_TYPE WIN32 )
    ENDIF( WIN32 )

234 235 236 237 238 239
    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)
240
        LIST( APPEND VLMC_SRCS Gui/preview/RenderWidget.mm )
241 242
message(${FOUNDATION_FRAMEWORK})
        list( APPEND VLMC_LIBS ${FOUNDATION_FRAMEWORK} ${APPKIT_FRAMEWORK} )
243 244 245 246
    ELSE( APPLE )
        ## Since there's no implementation on non-apple platforms, we need to process
        ## the header to generate MOC
        LIST( APPEND VLMC_SRCS Gui/preview/RenderWidget.h )
247 248 249
    ENDIF( APPLE )

    ADD_EXECUTABLE( vlmc ${GUI_TYPE} ${VLMC_SRCS} ${VLMC_MOC_SRCS} ${VLMC_UIS_H} ${VLMC_RCC_SRCS} )
250
    TARGET_LINK_LIBRARIES( vlmc ${VLMC_LIBS} )
251 252 253 254 255 256 257
    if (NOT Qt4_FOUND)
        qt_use_modules(vlmc Core Gui Widgets Xml Network)
    else()
        # We need to know the target for this one, which is not the case when doing most of the QT4/5 specific stuff.
        # We could hide this command in qt_use_modules macro, but this would be some kind of black magic uglyness
        TARGET_LINK_LIBRARIES(vlmc ${QT_LIBRARIES})
    endif()
258

259
ENDIF( NOT WITH_GUI )
260

261
ADD_DEPENDENCIES( vlmc translations )
Ludovic Fauvet's avatar
Ludovic Fauvet committed
262

263
INSTALL(TARGETS vlmc
264 265
        BUNDLE  DESTINATION ${VLMC_BIN_DIR}
        RUNTIME DESTINATION ${VLMC_BIN_DIR})
Ludovic Fauvet's avatar
Ludovic Fauvet committed
266

267 268 269 270 271
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
272

273 274
ADD_DEFINITIONS( -W -Wall )

275 276 277 278 279 280
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
281

282 283 284 285 286 287 288 289
if( APPLE )
    set(APPLICATION_BUNDLE ${CMAKE_BINARY_DIR}/bin/vlmc.app)
    set(APPLICATION_LIB_DIR ${LIBVLC_LIB_DIR})

    # re-enable this when we start addressing redistribution
    # message(STATUS "Looking for bundle ${APPLICATION_BUNDLE} with library path ${APPLICATION_LIB_DIR}")
    # install(CODE "include(BundleUtilities)
    add_custom_command(TARGET vlmc
290
        POST_BUILD
291 292 293 294
        COMMAND ${CMAKE_SOURCE_DIR}/cmake/FixBundle.sh ${APPLICATION_BUNDLE}/Contents/MacOS ${LIBVLC_LIB_DIR}
        COMMENT "Fixing application bundle for local run")
    # fixup_bundle(\"${APPLICATION_BUNDLE}\" \"\" \"${APPLICATION_LIB_DIR}\")" COMPONENT Runtime)
endif()