CMakeLists.txt 9.88 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
30
    Main/Core.cpp
31
    Main/main.cpp
Ludovic Fauvet's avatar
Ludovic Fauvet committed
32 33 34
    Media/Clip.cpp
    Media/Media.cpp
    Metadata/MetaDataManager.cpp
35
	Project/AutomaticBackup.cpp
36
	Project/Project.cpp
37 38
    Project/Workspace.cpp
    Project/WorkspaceWorker.cpp
39
	Project/RecentProjects.cpp
Ludovic Fauvet's avatar
Ludovic Fauvet committed
40
    Renderer/ClipRenderer.cpp
41
    Renderer/GenericRenderer.cpp
Ludovic Fauvet's avatar
Ludovic Fauvet committed
42 43
    Renderer/WorkflowFileRenderer.cpp
    Renderer/WorkflowRenderer.cpp
44
    Services/AbstractSharingService.h
45 46 47 48 49
    Services/UploaderIODevice.cpp
    Services/YouTube/YouTubeAuthenticator.cpp
    Services/YouTube/YouTubeFeedParser.cpp
    Services/YouTube/YouTubeService.cpp
    Services/YouTube/YouTubeUploader.cpp
50
    Settings/Settings.cpp
51
    Settings/SettingValue.cpp
52
    Tools/ErrorHandler.cpp
53
    Tools/MemoryPool.hpp
Ludovic Fauvet's avatar
Ludovic Fauvet committed
54
    Tools/QSingleton.hpp
55
    Tools/RendererEventWatcher.cpp
Ludovic Fauvet's avatar
Ludovic Fauvet committed
56 57
    Tools/Singleton.hpp
    Tools/Toggleable.hpp
58 59
    Tools/VlmcDebug.h
    Tools/VlmcLogger.cpp
60
    Workflow/AudioClipWorkflow.cpp
Ludovic Fauvet's avatar
Ludovic Fauvet committed
61
    Workflow/ClipWorkflow.cpp
62
    Workflow/ClipHelper.cpp
63
    Workflow/Helper.cpp
Ludovic Fauvet's avatar
Ludovic Fauvet committed
64 65 66 67
    Workflow/ImageClipWorkflow.cpp
    Workflow/MainWorkflow.cpp
    Workflow/TrackHandler.cpp
    Workflow/TrackWorkflow.cpp
68
    Workflow/Types.cpp
Ludovic Fauvet's avatar
Ludovic Fauvet committed
69 70 71
    Workflow/VideoClipWorkflow.cpp
  )

72
IF (WIN32)
Hugo Beauzee-Luyssen's avatar
Hugo Beauzee-Luyssen committed
73
    LIST ( APPEND VLMC_SRCS Main/winvlmc.cpp )
74
ELSE (WIN32)
75
    LIST( APPEND VLMC_SRCS Main/vlmc.cpp )
76 77
ENDIF(WIN32)

Ludovic Fauvet's avatar
Ludovic Fauvet committed
78
SET(VLMC_RCC
79 80
    ../resources.qrc
    ../ts/resources-ts.qrc
Ludovic Fauvet's avatar
Ludovic Fauvet committed
81 82
  )

83 84 85 86
IF (WIN32)
    LIST( APPEND VLMC_RCC ../resources/styles.qrc )
ENDIF (WIN32)

Ludovic Fauvet's avatar
Ludovic Fauvet committed
87 88 89 90 91
#include paths for vlmc
INCLUDE_DIRECTORIES(
  ${CMAKE_CURRENT_BINARY_DIR}
  ${CMAKE_CURRENT_BINARY_DIR}/src
  .
92
  Backend/VLC/LibVLCpp
Ludovic Fauvet's avatar
Ludovic Fauvet committed
93 94 95
  Gui
)

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

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

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

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

215 216
    QT_WRAP_UI(VLMC_UIS_H ${VLMC_UIS})
    QT_ADD_RESOURCES(VLMC_RCC_SRCS ${VLMC_RCC})
217

218
    IF( MINGW )
219 220 221 222 223 224
        # 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)
225
    ENDIF( MINGW )
226

227
    IF( WIN32 )
228 229 230
        SET( GUI_TYPE WIN32 )
    ENDIF( WIN32 )

231 232 233 234 235 236
    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)
237
        LIST( APPEND VLMC_SRCS Gui/preview/RenderWidget.mm )
238 239
message(${FOUNDATION_FRAMEWORK})
        list( APPEND VLMC_LIBS ${FOUNDATION_FRAMEWORK} ${APPKIT_FRAMEWORK} )
240 241 242 243
    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 )
244 245 246
    ENDIF( APPLE )

    ADD_EXECUTABLE( vlmc ${GUI_TYPE} ${VLMC_SRCS} ${VLMC_MOC_SRCS} ${VLMC_UIS_H} ${VLMC_RCC_SRCS} )
247
    TARGET_LINK_LIBRARIES( vlmc ${VLMC_LIBS} )
248 249 250 251 252 253 254
    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()
255

256
ENDIF( NOT WITH_GUI )
257

258
ADD_DEPENDENCIES( vlmc translations )
Ludovic Fauvet's avatar
Ludovic Fauvet committed
259

260
INSTALL(TARGETS vlmc
261 262
        BUNDLE  DESTINATION ${VLMC_BIN_DIR}
        RUNTIME DESTINATION ${VLMC_BIN_DIR})
Ludovic Fauvet's avatar
Ludovic Fauvet committed
263

264 265 266 267 268
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
269

Ludovic Fauvet's avatar
Ludovic Fauvet committed
270
ADD_DEFINITIONS( -W -Wall -Wextra )
271

272 273 274 275 276 277
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
278

279 280 281 282 283 284 285 286
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
287
        POST_BUILD
288 289 290 291
        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()