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

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

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

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

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

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

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

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

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

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

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

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

257
ENDIF( NOT WITH_GUI )
258

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

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

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

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

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

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