CMakeLists.txt 9.77 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
    Services/AbstractSharingService.h
33 34 35 36 37
    Services/UploaderIODevice.cpp
    Services/YouTube/YouTubeAuthenticator.cpp
    Services/YouTube/YouTubeFeedParser.cpp
    Services/YouTube/YouTubeService.cpp
    Services/YouTube/YouTubeUploader.cpp
38 39
    Settings/SettingsManager.cpp
    Settings/SettingValue.cpp
40
    Tools/ErrorHandler.cpp
41
    Tools/MemoryPool.hpp
Ludovic Fauvet's avatar
Ludovic Fauvet committed
42 43 44
    Tools/QSingleton.hpp
    Tools/Singleton.hpp
    Tools/Toggleable.hpp
45 46
    Tools/VlmcDebug.h
    Tools/VlmcLogger.cpp
47
    Workflow/AudioClipWorkflow.cpp
Ludovic Fauvet's avatar
Ludovic Fauvet committed
48
    Workflow/ClipWorkflow.cpp
49
    Workflow/ClipHelper.cpp
50
    Workflow/Helper.cpp
Ludovic Fauvet's avatar
Ludovic Fauvet committed
51 52 53 54
    Workflow/ImageClipWorkflow.cpp
    Workflow/MainWorkflow.cpp
    Workflow/TrackHandler.cpp
    Workflow/TrackWorkflow.cpp
55
    Workflow/Types.cpp
Ludovic Fauvet's avatar
Ludovic Fauvet committed
56 57 58
    Workflow/VideoClipWorkflow.cpp
  )

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

Ludovic Fauvet's avatar
Ludovic Fauvet committed
65
SET(VLMC_RCC
66 67
    ../resources.qrc
    ../ts/resources-ts.qrc
Ludovic Fauvet's avatar
Ludovic Fauvet committed
68 69
  )

70 71 72 73
IF (WIN32)
    LIST( APPEND VLMC_RCC ../resources/styles.qrc )
ENDIF (WIN32)

Ludovic Fauvet's avatar
Ludovic Fauvet committed
74 75 76 77 78 79
#include paths for vlmc
INCLUDE_DIRECTORIES(
  ${CMAKE_CURRENT_BINARY_DIR}
  ${CMAKE_CURRENT_BINARY_DIR}/src
  .
  Commands
80
  EffectsEngine
81
  Settings
Ludovic Fauvet's avatar
Ludovic Fauvet committed
82
  Gui
83
  Gui/effectsengine
Ludovic Fauvet's avatar
Ludovic Fauvet committed
84 85
  Gui/import
  Gui/library
86
  Gui/media
87
  Gui/preview
Ludovic Fauvet's avatar
Ludovic Fauvet committed
88 89 90 91 92 93 94 95 96 97
  Gui/settings
  Gui/timeline
  Gui/widgets
  Gui/wizard
  Library
  LibVLCpp
  Media
  Metadata
  Project
  Renderer
98 99
  Services
  Services/YouTube
Ludovic Fauvet's avatar
Ludovic Fauvet committed
100 101 102 103
  Tools
  Workflow
)

104 105
CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/cmake/config.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config.h)

106
IF (NOT WITH_GUI)
107
    LIST (APPEND VLMC_SRCS Main/main.cpp Renderer/ConsoleRenderer.cpp )
108
    QT_ADD_RESOURCES(VLMC_RCC_SRCS ${VLMC_RCC})
109
    ADD_EXECUTABLE(vlmc ${GUI_TYPE} ${VLMC_SRCS} ${VLMC_MOC_SRCS} ${VLMC_RCC_SRCS})
110
    qt_use_modules(vlmc Core Xml Network)
111
    TARGET_LINK_LIBRARIES(vlmc ${VLMC_LIBS})
Ludovic Fauvet's avatar
Ludovic Fauvet committed
112

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

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

226 227
    QT_WRAP_UI(VLMC_UIS_H ${VLMC_UIS})
    QT_ADD_RESOURCES(VLMC_RCC_SRCS ${VLMC_RCC})
228

229
    IF( MINGW )
230 231 232 233 234 235
        # 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)
236
    ENDIF( MINGW )
237

238
    IF( WIN32 )
239 240 241
        SET( GUI_TYPE WIN32 )
    ENDIF( WIN32 )

242 243 244 245 246 247
    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)
248
        LIST( APPEND VLMC_SRCS Gui/preview/RenderWidget.mm )
249 250
message(${FOUNDATION_FRAMEWORK})
        list( APPEND VLMC_LIBS ${FOUNDATION_FRAMEWORK} ${APPKIT_FRAMEWORK} )
251 252 253 254
    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 )
255 256 257
    ENDIF( APPLE )

    ADD_EXECUTABLE( vlmc ${GUI_TYPE} ${VLMC_SRCS} ${VLMC_MOC_SRCS} ${VLMC_UIS_H} ${VLMC_RCC_SRCS} )
258
    TARGET_LINK_LIBRARIES( vlmc ${VLMC_LIBS} )
259 260 261 262 263 264 265
	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()
266

267
ENDIF( NOT WITH_GUI )
268

269
ADD_DEPENDENCIES( vlmc translations )
Ludovic Fauvet's avatar
Ludovic Fauvet committed
270

271
INSTALL(TARGETS vlmc
272 273
        BUNDLE  DESTINATION ${VLMC_BIN_DIR}
        RUNTIME DESTINATION ${VLMC_BIN_DIR})
Ludovic Fauvet's avatar
Ludovic Fauvet committed
274

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

281 282
ADD_DEFINITIONS( -W -Wall )

283 284 285 286 287 288
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
289

290 291 292 293 294 295 296 297
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
298
        POST_BUILD
299 300 301 302
        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()