From: Alberto Villa Date: Wed, 9 Nov 2011 00:31:03 +0000 (+0100) Subject: Reorganise (again) the build system X-Git-Url: https://git.sesse.net/?p=kdenlive;a=commitdiff_plain;h=5391828a0c103944aff2b21c4bea5d86d1903f1b Reorganise (again) the build system - Require at least Qt 4.6 and KDE 4.4. - List dependencies when configuring. - Cleanup Qt dependencies handling. There is no need anymore to include specific Qt libraries in target_link_libraries(), as QT_LIBRARIES will be adjusted according to the modules requested in find_package(). - Move from platform checks to feature checks (should solve problems on GNU/kFreeBSD). Some Mac OS X checks are still there: I'll see what to do with them. - Make Video4Linux support optional. - Last (and least), tidy up CMakeLists.txt. --- diff --git a/CMakeLists.txt b/CMakeLists.txt index 28a04d63..45d37d45 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,15 +1,19 @@ project(kdenlive) set(catalogname kdenlive) -# An odd minor version number means development version, while an even -# one means stable release. +# An odd patch version number means development version, while an even one means +# stable release. An additional number can be used for bugfix-only releases. set(KDENLIVE_VERSION 0.8.3) -set(LIBMLT_REQUIRED_VERSION 0.7.6) + +# Minimum versions of main dependencies. +set(LIBMLT_MIN_VERSION 0.7.6) +set(QT_MIN_VERSION 4.6.0) +set(KDE_MIN_VERSION 4.4.0) set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/modules) # To be switched on when releasing. -option(RELEASE_BUILD "Remove Git position from program version (use for stable releases)" OFF) +option(RELEASE_BUILD "Remove Git revision from program version (use for stable releases)" OFF) # Get current version. set(VERSION "\"${KDENLIVE_VERSION}\"") @@ -42,28 +46,41 @@ find_program(MSGMERGE_EXECUTABLE msgmerge) find_program(XGETTEXT_EXECUTABLE xgettext) # Search KDE and dependent packages. -find_package(KDE4 REQUIRED) +find_package(KDE4 ${KDE_MIN_VERSION} REQUIRED) include(KDE4Defaults) include(MacroLibrary) include(FindGettext) +macro_log_feature(KDE4_FOUND + "KDELibs" + "KDE core libraries" + "http://www.kde.org" + TRUE + ${KDE_MIN_VERSION} +) + +# Find Qt core modules (QtCore and QtGui are searched by default). +find_package(Qt4 ${QT_MIN_VERSION} REQUIRED QtDBus) +macro_log_feature(QT_QTDBUS_FOUND + "QtDBus" + "Qt bindings for the D-Bus library" + "http://qt.nokia.com/products/qt" + TRUE + ${QT_MIN_VERSION} + "QtDBus library (most likely called libqt4-dbus)" +) # Search MLT package. find_package(LIBMLT REQUIRED) -if(LIBMLT_VERSION VERSION_LESS ${LIBMLT_REQUIRED_VERSION}) +if(LIBMLT_VERSION VERSION_LESS ${LIBMLT_MIN_VERSION}) set(LIBMLT_FOUND FALSE) -endif(LIBMLT_VERSION VERSION_LESS ${LIBMLT_REQUIRED_VERSION}) -macro_log_feature(LIBMLT_FOUND "MLT" "Multimedia framework and video playout server for TV broadcasting" "http://mltframework.org" TRUE ${LIBMLT_REQUIRED_VERSION}) - -set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} --std=c99") # To compile kiss_fft -find_package(Qt4 COMPONENTS QtCore QtGui QtOpenGL QtScript REQUIRED) -if ( NOT QT_QTOPENGL_FOUND ) - message(FATAL_ERROR "QtOpenGL (most likely called libqt4-opengl-dev) not found.") -else ( NOT QT_QTOPENGL_FOUND ) - message(-- " Found QtOpenGL.") -endif ( NOT QT_QTOPENGL_FOUND ) -find_library(Qt COMPONENTS QtOpenGL QtScript REQUIRED) - -add_definitions(${QT_DEFINITIONS}) +endif(LIBMLT_VERSION VERSION_LESS ${LIBMLT_MIN_VERSION}) +macro_log_feature(LIBMLT_FOUND + "MLT" + "Multimedia framework and video playout server for TV broadcasting" + "http://mltframework.org" + TRUE + ${LIBMLT_MIN_VERSION} +) add_subdirectory(data) add_subdirectory(doc) @@ -74,9 +91,9 @@ add_subdirectory(lumas) add_subdirectory(man) add_subdirectory(plugins) add_subdirectory(po) -add_subdirectory(renderer renderer/cmake_bindir) -add_subdirectory(src src/cmake_bindir) -add_subdirectory(thumbnailer thumbnailer/cmake_bindir) +add_subdirectory(renderer) +add_subdirectory(src) +add_subdirectory(thumbnailer) add_subdirectory(titles) macro_display_feature_log() diff --git a/kdenlive-config.h.cmake b/kdenlive-config.h.cmake index 2f43f50c..328512ef 100644 --- a/kdenlive-config.h.cmake +++ b/kdenlive-config.h.cmake @@ -3,5 +3,8 @@ #cmakedefine VERSION @VERSION@ +#cmakedefine HAVE_MALLOC_H 1 +#cmakedefine HAVE_PTHREAD_H 1 + #endif diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 200cc422..cb73bbd6 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1,6 +1,72 @@ +find_package(OpenGL REQUIRED) +find_package(Qt4 ${QT_MIN_VERSION} REQUIRED QtOpenGL QtScript) +if(APPLE) + find_package(SDL REQUIRED) +endif(APPLE) macro_optional_find_package(Nepomuk) macro_optional_find_package(QJSON) +option(WITH_V4L "Build capture support with Video4Linux" ON) +option(WITH_JogShuttle "Build Jog/Shuttle support" ON) + +if(WITH_V4L) + # This can be changed to support FreeBSD as soon as we move to a newer V4L2 + # header. + check_include_files(linux/ioctl.h HAVE_LINUX_IOCTL_H) + if(HAVE_LINUX_IOCTL_H) + set(BUILD_V4L TRUE) + endif(HAVE_LINUX_IOCTL_H) +endif(WITH_V4L) + +if(WITH_JogShuttle) + check_include_files(linux/input.h HAVE_LINUX_INPUT_H) + if(HAVE_LINUX_INPUT_H) + set(BUILD_JogShuttle TRUE) + endif(HAVE_LINUX_INPUT_H) +endif(WITH_JogShuttle) + +macro_log_feature(QT_QTOPENGL_FOUND + "QtOpenGL" + "Qt bindings for the OpenGL library" + "http://qt.nokia.com/products/qt" + TRUE + ${QT_MIN_VERSION} + "QtOpenGL library and headers (most likely called libqt4-opengl and libqt4-opengl-dev)" +) + +macro_log_feature(QT_QTSCRIPT_FOUND + "QtScript" + "Qt module providing core scripting facilities" + "http://qt.nokia.com/products/qt" + TRUE + ${QT_MIN_VERSION} + "QtScript library (most likely called libqt4-script)" +) + +if(APPLE) + macro_log_feature(SDL_FOUND + "SDL" + "Cross-platform multimedia library" + "http://www.libsdl.org" + TRUE + ) +endif(APPLE) + +macro_log_feature(Nepomuk_FOUND + "Nepomuk" + "Support for the Nepomuk semantic desktop system" + "http://nepomuk.semanticdesktop.org" +) + +macro_log_feature(QJSON_FOUND + "QJson" + "Qt-based library that maps JSON data to QVariant objects" + "http://qjson.sourceforge.net" + FALSE + "" + "Required to build the rotoscoping filter" +) + add_subdirectory(audioscopes) add_subdirectory(beziercurve) add_subdirectory(blackmagic) @@ -15,275 +81,278 @@ add_subdirectory(simplekeyframes) add_subdirectory(stopmotion) if(QJSON_FOUND) - add_subdirectory(rotoscoping) add_subdirectory(onmonitoritems/rotoscoping) - include_directories(QJSON_INCLUDE_DIR) - set(optional_libs ${optional_libs} ${QJSON_LIBRARIES}) - add_definitions(-DQJSON) -else(QJSON_FOUND) - message(STATUS "Install QJson to use the rotoscoping filter") + add_subdirectory(rotoscoping) endif(QJSON_FOUND) -if(NOT APPLE AND NOT CMAKE_SYSTEM_NAME STREQUAL "FreeBSD" AND NOT CMAKE_SYSTEM_NAME STREQUAL "GNU/kFreeBSD") +if(BUILD_V4L) add_subdirectory(v4l) -endif(NOT APPLE AND NOT CMAKE_SYSTEM_NAME STREQUAL "FreeBSD" AND NOT CMAKE_SYSTEM_NAME STREQUAL "GNU/kFreeBSD") - -include_directories( - ${KDE4_INCLUDE_DIR} - ${KDE4_INCLUDE_DIR}/KDE - ${QT_INCLUDES} - ${LIBMLT_INCLUDE_DIR} - ${LIBMLTPLUS_INCLUDE_DIR} - ${QDBUS_INCLUDE_DIRS} - ${CMAKE_CURRENT_BINARY_DIR} - ${CMAKE_BINARY_DIR} -) - -if(Nepomuk_FOUND) - include_directories(NEPOMUK_INCLUDES) - set(optional_libs ${optional_libs} ${NEPOMUK_LIBRARIES}) - add_definitions(-DNEPOMUK) -endif(Nepomuk_FOUND) - -if(Q_WS_X11) - include_directories(${X11_Xlib_INCLUDE_PATH}) -endif(Q_WS_X11) - -if(APPLE) - find_package(OpenGL) - set(QT_USE_QTOPENGL TRUE) -else(APPLE) - macro_optional_find_package(OpenGL) -endif(APPLE) +endif(BUILD_V4L) +list(APPEND kdenlive_SRCS + main.cpp + mainwindow.cpp -link_libraries( - ${LIBMLT_LIBRARY} - ${LIBMLTPLUS_LIBRARY} - ${optional_libs} + KoSliderCombo.cpp + abstractclipitem.cpp + abstractgroupitem.cpp + abstractmonitor.cpp + abstractscopewidget.cpp + archivewidget.cpp + audiosignal.cpp + choosecolorwidget.cpp + clipdurationdialog.cpp + clipitem.cpp + clipmanager.cpp + clipproperties.cpp + cliptranscode.cpp + colorpickerwidget.cpp + colorplaneexport.cpp + colortools.cpp + complexparameter.cpp + cornerswidget.cpp + customruler.cpp + customtrackscene.cpp + customtrackview.cpp + docclipbase.cpp + documentchecker.cpp + documentvalidator.cpp + doubleparameterwidget.cpp + dragvalue.cpp + dvdwizard.cpp + dvdwizardchapters.cpp + dvdwizardmenu.cpp + dvdwizardvob.cpp + effectslist.cpp + effectslistview.cpp + effectslistwidget.cpp + effectstackedit.cpp + effectstackview.cpp + encodingprofilesdialog.cpp + folderprojectitem.cpp + gentime.cpp + geometryval.cpp + geometrywidget.cpp + graphicsscenerectmove.cpp + guide.cpp + headertrack.cpp + initeffects.cpp + kdenlivedoc.cpp + kdenlivesettingsdialog.cpp + keyframeedit.cpp + keyframehelper.cpp + kis_cubic_curve.cpp + kis_curve_widget.cpp + kthumb.cpp + managecapturesdialog.cpp + markerdialog.cpp + mltdevicecapture.cpp + monitor.cpp + monitoreditwidget.cpp + monitormanager.cpp + monitorscene.cpp + noteswidget.cpp + parameterplotter.cpp + positionedit.cpp + profilesdialog.cpp + projectitem.cpp + projectlist.cpp + projectlistview.cpp + projectsettings.cpp + recmonitor.cpp + renderer.cpp + renderwidget.cpp + slideshowclip.cpp + smallruler.cpp + spacerdialog.cpp + statusbarmessagelabel.cpp + subprojectitem.cpp + timecode.cpp + timecodedisplay.cpp + titledocument.cpp + titlewidget.cpp + trackdialog.cpp + tracksconfigdialog.cpp + trackview.cpp + transition.cpp + transitionsettings.cpp + unicodedialog.cpp + wizard.cpp ) -kde4_add_ui_files(kdenlive_UI - widgets/timeline_ui.ui - widgets/recmonitor_ui.ui +kde4_add_ui_files(kdenlive_UIS + widgets/addtrack_ui.ui + widgets/archivewidget_ui.ui + widgets/audiospectrum_ui.ui + widgets/backupdialog_ui.ui + widgets/bezierspline_ui.ui + widgets/boolval_ui.ui + widgets/clipdurationdialog_ui.ui + widgets/clipproperties_ui.ui + widgets/cliptranscode_ui.ui widgets/colorclip_ui.ui - widgets/slideshowclip_ui.ui - widgets/configmisc_ui.ui + widgets/colorplaneexport_ui.ui + widgets/configcapture_ui.ui widgets/configenv_ui.ui - widgets/configtimeline_ui.ui + widgets/configjogshuttle_ui.ui + widgets/configmisc_ui.ui + widgets/configproject_ui.ui widgets/configsdl_ui.ui - widgets/configcapture_ui.ui + widgets/configtimeline_ui.ui widgets/configtranscode_ui.ui - widgets/configproject_ui.ui + widgets/dvdwizardchapters_ui.ui + widgets/dvdwizardmenu_ui.ui + widgets/dvdwizardstatus_ui.ui + widgets/dvdwizardvob_ui.ui widgets/effectlist_ui.ui widgets/effectstack_ui.ui - widgets/profiledialog_ui.ui - widgets/projectsettings_ui.ui + widgets/geometryval_ui.ui + widgets/geometrywidget_ui.ui + widgets/histogram_ui.ui + widgets/keyframedialog_ui.ui + widgets/keyframeeditor_ui.ui widgets/keyframewidget_ui.ui widgets/listval_ui.ui - widgets/wipeval_ui.ui - widgets/boolval_ui.ui - widgets/titlewidget_ui.ui - widgets/unicodedialog_ui.ui - widgets/timelinebuttons_ui.ui + widgets/managecaptures_ui.ui + widgets/manageencodingprofile_ui.ui + widgets/markerdialog_ui.ui + widgets/missingclips_ui.ui + widgets/monitoreditwidget_ui.ui + widgets/profiledialog_ui.ui + widgets/projectsettings_ui.ui + widgets/recmonitor_ui.ui widgets/renderwidget_ui.ui + widgets/rgbparade_ui.ui widgets/saveprofile_ui.ui - widgets/transitionsettings_ui.ui - widgets/configjogshuttle_ui.ui - widgets/trackheader_ui.ui - widgets/clipproperties_ui.ui - widgets/markerdialog_ui.ui - widgets/keyframedialog_ui.ui - widgets/clipdurationdialog_ui.ui - widgets/managecaptures_ui.ui - widgets/geometryval_ui.ui - widgets/wizardstandard_ui.ui - widgets/wizardextra_ui.ui - widgets/wizardcapture_ui.ui - widgets/wizardcheck_ui.ui - widgets/wizardmltcheck_ui.ui + widgets/slideshowclip_ui.ui + widgets/smconfig_ui.ui widgets/spacerdialog_ui.ui - widgets/addtrack_ui.ui - widgets/dvdwizardvob_ui.ui - widgets/dvdwizardmenu_ui.ui - widgets/dvdwizardstatus_ui.ui - widgets/dvdwizardchapters_ui.ui - widgets/missingclips_ui.ui - widgets/cliptranscode_ui.ui + widgets/spectrogram_ui.ui + widgets/stopmotion_ui.ui widgets/templateclip_ui.ui - widgets/keyframeeditor_ui.ui + widgets/timeline_ui.ui + widgets/timelinebuttons_ui.ui + widgets/titlewidget_ui.ui + widgets/trackheader_ui.ui widgets/tracksconfigdialog_ui.ui + widgets/transitionsettings_ui.ui + widgets/unicodedialog_ui.ui widgets/urlval_ui.ui widgets/vectorscope_ui.ui - widgets/colorplaneexport_ui.ui widgets/waveform_ui.ui - widgets/rgbparade_ui.ui - widgets/histogram_ui.ui - widgets/geometrywidget_ui.ui - widgets/stopmotion_ui.ui - widgets/audiospectrum_ui.ui - widgets/spectrogram_ui.ui - widgets/smconfig_ui.ui - widgets/bezierspline_ui.ui - widgets/monitoreditwidget_ui.ui - widgets/archivewidget_ui.ui - widgets/manageencodingprofile_ui.ui - widgets/backupdialog_ui.ui -) - -set(kdenlive_SRCS - ${kdenlive_SRCS} - main.cpp - mainwindow.cpp - customruler.cpp - smallruler.cpp - projectlist.cpp - projectitem.cpp - monitor.cpp - gentime.cpp - renderer.cpp - kdenlivedoc.cpp - projectlistview.cpp - trackview.cpp - docclipbase.cpp - timecode.cpp - monitormanager.cpp - headertrack.cpp - customtrackview.cpp - clipitem.cpp - kthumb.cpp - clipmanager.cpp - effectslist.cpp - initeffects.cpp - effectslistview.cpp - effectstackview.cpp - effectstackedit.cpp - parameterplotter.cpp - profilesdialog.cpp - projectsettings.cpp - kdenlivesettingsdialog.cpp - complexparameter.cpp - titlewidget.cpp - unicodedialog.cpp - graphicsscenerectmove.cpp - effectslistwidget.cpp - titledocument.cpp - transition.cpp - renderwidget.cpp - abstractclipitem.cpp - transitionsettings.cpp - recmonitor.cpp - clipproperties.cpp - slideshowclip.cpp - markerdialog.cpp - guide.cpp - statusbarmessagelabel.cpp - clipdurationdialog.cpp - managecapturesdialog.cpp - geometryval.cpp - wizard.cpp - customtrackscene.cpp - abstractgroupitem.cpp - keyframehelper.cpp - spacerdialog.cpp - dvdwizardvob.cpp - dvdwizardmenu.cpp - dvdwizard.cpp - documentchecker.cpp - dvdwizardchapters.cpp - documentvalidator.cpp - cliptranscode.cpp - keyframeedit.cpp - positionedit.cpp - trackdialog.cpp - subprojectitem.cpp - folderprojectitem.cpp - KoSliderCombo.cpp - kis_cubic_curve.cpp - kis_curve_widget.cpp - timecodedisplay.cpp - tracksconfigdialog.cpp - abstractscopewidget.cpp - colorplaneexport.cpp - colortools.cpp - colorpickerwidget.cpp - choosecolorwidget.cpp - monitorscene.cpp - geometrywidget.cpp - doubleparameterwidget.cpp - audiosignal.cpp - cornerswidget.cpp - dragvalue.cpp - monitoreditwidget.cpp - noteswidget.cpp - archivewidget.cpp - mltdevicecapture.cpp - abstractmonitor.cpp - encodingprofilesdialog.cpp + widgets/wipeval_ui.ui + widgets/wizardcapture_ui.ui + widgets/wizardcheck_ui.ui + widgets/wizardextra_ui.ui + widgets/wizardmltcheck_ui.ui + widgets/wizardstandard_ui.ui ) -add_definitions(${KDE4_DEFINITIONS}) +if(OPENGL_FOUND) + list(APPEND kdenlive_SRCS videoglwidget.cpp) +endif(OPENGL_FOUND) -if(CMAKE_SYSTEM_NAME STREQUAL "GNU/kFreeBSD") - add_definitions(-DQ_OS_KFREEBSD) -endif(CMAKE_SYSTEM_NAME STREQUAL "GNU/kFreeBSD") +if(BUILD_JogShuttle) + list(APPEND kdenlive_SRCS + jogaction.cpp + jogshuttle.cpp + jogshuttleconfig.cpp + ) +endif(BUILD_JogShuttle) -if(APPLE OR CMAKE_SYSTEM_NAME STREQUAL "FreeBSD" OR CMAKE_SYSTEM_NAME STREQUAL "NetBSD" OR CMAKE_SYSTEM_NAME STREQUAL "GNU/kFreeBSD" OR NO_JOGSHUTTLE) - add_definitions(-DNO_JOGSHUTTLE) -else(APPLE OR CMAKE_SYSTEM_NAME STREQUAL "FreeBSD" OR CMAKE_SYSTEM_NAME STREQUAL "NetBSD" OR CMAKE_SYSTEM_NAME STREQUAL "GNU/kFreeBSD" OR NO_JOGSHUTTLE) - set(kdenlive_SRCS jogshuttle.cpp jogaction.cpp jogshuttleconfig.cpp ${kdenlive_SRCS}) -endif(APPLE OR CMAKE_SYSTEM_NAME STREQUAL "FreeBSD" OR CMAKE_SYSTEM_NAME STREQUAL "NetBSD" OR CMAKE_SYSTEM_NAME STREQUAL "GNU/kFreeBSD" OR NO_JOGSHUTTLE) +kde4_add_kcfg_files(kdenlive_SRCS kdenlivesettings.kcfgc) +qt4_add_dbus_adaptor(kdenlive_SRCS + org.kdenlive.MainWindow.xml + mainwindow.h + MainWindow +) +qt4_add_resources(kdenlive_SRCS widgets/resources.qrc) +kde4_add_executable(kdenlive + ${kdenlive_SRCS} + ${kdenlive_UIS} +) -if(APPLE OR OPENGL_FOUND) - add_definitions(-DUSE_OPEN_GL) - set(kdenlive_SRCS videoglwidget.cpp ${kdenlive_SRCS}) -endif(APPLE OR OPENGL_FOUND) +# To compile kiss_fft. +set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} --std=c99") -# Add libdl -find_library(DL_LIB NAMES ${CMAKE_DL_LIBS}) -message(STATUS "using dl library: ${DL_LIB}") +# KDE definitions and include directories *must* always come first, Qt follows +# (to avoid breaking builds when KDE and/or Qt are installed to different +# prefixes). +add_definitions(${KDE4_DEFINITIONS}) -kde4_add_kcfg_files(kdenlive_SRCS kdenlivesettings.kcfgc) -qt4_add_dbus_adaptor(kdenlive_SRCS org.kdenlive.MainWindow.xml mainwindow.h MainWindow) -qt4_add_resources(kdenlive_SRCS widgets/resources.qrc) -kde4_add_executable(kdenlive ${kdenlive_SRCS} ${kdenlive_UI}) +include_directories( + ${KDE4_INCLUDES} # Adds Qt include directories too. + ${LIBMLT_INCLUDE_DIR} + ${LIBMLTPLUS_INCLUDE_DIR} + ${CMAKE_BINARY_DIR} + ${CMAKE_CURRENT_BINARY_DIR} +) -set(KNEWSTUFF_LIBS ${KDE4_KNEWSTUFF3_LIBS}) +# Adds Qt definitions and include directories, and sets QT_LIBRARIES according +# to the components requested in find_package(). +include(UseQt4) target_link_libraries(kdenlive ${KDE4_KDEUI_LIBS} ${KDE4_KIO_LIBS} - ${KNEWSTUFF_LIBS} - ${LIBMLTPLUS_LIBRARY} - ${LIBMLT_LIBRARY} - ${optional_libs} + ${KDE4_KNEWSTUFF3_LIBS} ${KDE4_KNOTIFYCONFIG_LIBRARY} ${KDE4_KROSSUI_LIBS} + ${QT_LIBRARIES} + ${LIBMLT_LIBRARY} + ${LIBMLTPLUS_LIBRARY} ${CMAKE_DL_LIBS} ${CMAKE_THREAD_LIBS_INIT} - ${QT_QTSCRIPT_LIBRARY} ) if(Q_WS_X11) + include_directories(${X11_Xlib_INCLUDE_PATH}) target_link_libraries(kdenlive ${X11_LIBRARIES}) endif(Q_WS_X11) -if(APPLE) - find_package(SDL REQUIRED) - target_link_libraries(kdenlive ${SDL_LIBRARY}) - target_link_libraries(kdenlive ${QT_QTOPENGL_LIBRARY}) +if(OPENGL_FOUND AND QT_QTOPENGL_FOUND) + add_definitions(-DUSE_OPENGL) target_link_libraries(kdenlive ${OPENGL_LIBRARIES}) -else(APPLE) - add_definitions(-DHAVE_V4L2) - if(OPENGL_FOUND) - target_link_libraries(kdenlive ${QT_QTOPENGL_LIBRARY}) - target_link_libraries(kdenlive ${OPENGL_LIBRARIES}) - endif(OPENGL_FOUND) -endif(APPLE) +endif(OPENGL_FOUND AND QT_QTOPENGL_FOUND) + +if(SDL_FOUND) + target_link_libraries(kdenlive ${SDL_LIBRARY}) +endif(SDL_FOUND) + +if(Nepomuk_FOUND) + add_definitions(-DUSE_NEPOMUK) + include_directories(${NEPOMUK_INCLUDES}) + target_link_libraries(kdenlive ${NEPOMUK_LIBRARIES}) +endif(Nepomuk_FOUND) + +if(QJSON_FOUND) + add_definitions(-DUSE_QJSON) + include_directories(${QJSON_INCLUDE_DIR}) + target_link_libraries(kdenlive ${QJSON_LIBRARIES}) +endif(QJSON_FOUND) + +if(BUILD_V4L) + add_definitions(-DUSE_V4L) +endif(BUILD_V4L) + +if(BUILD_JogShuttle) + add_definitions(-DUSE_JOGSHUTTLE) +endif(BUILD_JogShuttle) install(TARGETS kdenlive DESTINATION ${BIN_INSTALL_DIR}) -install(FILES kdenliveui.rc kdenlive.notifyrc DESTINATION ${DATA_INSTALL_DIR}/kdenlive) +install(FILES + kdenliveui.rc + kdenlive.notifyrc + DESTINATION ${DATA_INSTALL_DIR}/kdenlive +) install(FILES kdenlivesettings.kcfg DESTINATION ${KCFG_INSTALL_DIR}) -install(FILES kdenlive.desktop DESTINATION ${XDG_APPS_INSTALL_DIR}) +install(FILES + kdenlive_projectprofiles.knsrc + kdenlive_renderprofiles.knsrc + kdenlive_titles.knsrc + kdenlive_wipes.knsrc + kdenlivetranscodingrc + DESTINATION ${CONFIG_INSTALL_DIR} +) kde4_install_icons(${ICON_INSTALL_DIR}) -install(FILES kdenlive_titles.knsrc kdenlive_wipes.knsrc kdenlive_renderprofiles.knsrc kdenlive_projectprofiles.knsrc kdenlivetranscodingrc DESTINATION ${CONFIG_INSTALL_DIR}) +install(FILES kdenlive.desktop DESTINATION ${XDG_APPS_INSTALL_DIR}) diff --git a/src/clipitem.cpp b/src/clipitem.cpp index 9f6f0420..cac5eda2 100644 --- a/src/clipitem.cpp +++ b/src/clipitem.cpp @@ -27,7 +27,7 @@ #include "kdenlivesettings.h" #include "kthumb.h" #include "profilesdialog.h" -#ifdef QJSON +#ifdef USE_QJSON #include "rotoscoping/rotowidget.h" #endif @@ -1844,7 +1844,7 @@ QMap ClipItem::adjustEffectsToDuration(int width, int height, if (!effects.contains(i)) effects[i] = effect.cloneNode().toElement(); updateNormalKeyframes(param); -#ifdef QJSON +#ifdef USE_QJSON } else if (type == "roto-spline") { if (!effects.contains(i)) effects[i] = effect.cloneNode().toElement(); diff --git a/src/effectstackedit.cpp b/src/effectstackedit.cpp index 7253b495..2a956679 100644 --- a/src/effectstackedit.cpp +++ b/src/effectstackedit.cpp @@ -35,7 +35,7 @@ #include "doubleparameterwidget.h" #include "cornerswidget.h" #include "beziercurve/beziersplinewidget.h" -#ifdef QJSON +#ifdef USE_QJSON #include "rotoscoping/rotowidget.h" #endif @@ -457,7 +457,7 @@ void EffectStackEdit::transferParamDesc(const QDomElement &d, ItemInfo info, boo QString depends = pa.attribute("depends"); if (!depends.isEmpty()) meetDependency(paramName, type, EffectsList::parameter(d, depends)); -#ifdef QJSON +#ifdef USE_QJSON } else if (type == "roto-spline") { RotoWidget *roto = new RotoWidget(value, m_monitor, info, m_timecode, this); roto->slotShowScene(!disable); @@ -751,7 +751,7 @@ void EffectStackEdit::collectAllParameters() QString depends = pa.attributes().namedItem("depends").nodeValue(); if (!depends.isEmpty()) meetDependency(paramName, type, EffectsList::parameter(newparam, depends)); -#ifdef QJSON +#ifdef USE_QJSON } else if (type == "roto-spline") { RotoWidget *widget = static_cast(m_valueItems.value(paramName)); setValue = widget->getSpline(); diff --git a/src/kdenlivesettingsdialog.cpp b/src/kdenlivesettingsdialog.cpp index cb0e06b9..5fe10437 100644 --- a/src/kdenlivesettingsdialog.cpp +++ b/src/kdenlivesettingsdialog.cpp @@ -19,7 +19,7 @@ #include "kdenlivesettingsdialog.h" #include "profilesdialog.h" -#if !defined(Q_OS_FREEBSD) && !defined(Q_OS_KFREEBSD) +#ifdef USE_V4L #include "v4l/v4lcapture.h" #endif #include "blackmagic/devices.h" @@ -43,11 +43,11 @@ #include #include #include -#ifndef NO_JOGSHUTTLE +#ifdef USE_JOGSHUTTLE #include "jogaction.h" #include "jogshuttleconfig.h" #include -#endif /* NO_JOGSHUTTLE */ +#endif KdenliveSettingsDialog::KdenliveSettingsDialog(const QMap& mappable_actions, QWidget * parent) : @@ -97,7 +97,7 @@ KdenliveSettingsDialog::KdenliveSettingsDialog(const QMap& map QWidget *p4 = new QWidget; m_configCapture.setupUi(p4); -#if !defined(Q_WS_MAC) && !defined(Q_OS_FREEBSD) && !defined(Q_OS_KFREEBSD) +#ifdef USE_V4L // Video 4 Linux device detection for (int i = 0; i < 10; i++) { @@ -120,18 +120,15 @@ KdenliveSettingsDialog::KdenliveSettingsDialog(const QMap& map m_page4 = addPage(p4, i18n("Capture"), "media-record"); m_configCapture.tabWidget->setCurrentIndex(KdenliveSettings::defaultcapture()); -#ifdef Q_WS_MAC +#ifndef USE_V4L m_configCapture.tabWidget->setEnabled(false); m_configCapture.kcfg_defaultcapture->setEnabled(false); - m_configCapture.label->setText(i18n("Capture is not yet available on OS X.")); + m_configCapture.label->setText(i18n("Capture is not yet available on this platform.")); #endif QWidget *p5 = new QWidget; m_configShuttle.setupUi(p5); -#ifdef NO_JOGSHUTTLE - m_configShuttle.kcfg_enableshuttle->hide(); - m_configShuttle.kcfg_enableshuttle->setDisabled(true); -#else +#ifdef USE_JOGSHUTTLE connect(m_configShuttle.kcfg_enableshuttle, SIGNAL(stateChanged(int)), this, SLOT(slotCheckShuttle(int))); connect(m_configShuttle.shuttledevicelist, SIGNAL(activated(int)), this, SLOT(slotUpdateShuttleDevice(int))); slotCheckShuttle(KdenliveSettings::enableshuttle()); @@ -171,13 +168,16 @@ KdenliveSettingsDialog::KdenliveSettingsDialog(const QMap& map if (i < actions_map.size()) button->setCurrentIndex(action_pos[actions_map[i]]); } -#endif /* NO_JOGSHUTTLE */ +#else /* ! USE_JOGSHUTTLE */ + m_configShuttle.kcfg_enableshuttle->hide(); + m_configShuttle.kcfg_enableshuttle->setDisabled(true); +#endif /* USE_JOGSHUTTLE */ m_page5 = addPage(p5, i18n("JogShuttle"), "input-mouse"); QWidget *p6 = new QWidget; m_configSdl.setupUi(p6); -#if not defined(Q_WS_MAC) && not defined(USE_OPEN_GL) +#ifndef USE_OPENGL m_configSdl.kcfg_openglmonitors->setHidden(true); #endif @@ -506,7 +506,7 @@ void KdenliveSettingsDialog::slotEditImageApplication() m_configEnv.kcfg_defaultimageapp->setText(service->exec()); } -#ifndef NO_JOGSHUTTLE +#ifdef USE_JOGSHUTTLE void KdenliveSettingsDialog::slotCheckShuttle(int state) { m_configShuttle.config_group->setEnabled(state); @@ -536,13 +536,13 @@ void KdenliveSettingsDialog::slotUpdateShuttleDevice(int ix) m_configShuttle.kcfg_shuttledevice->setText(device); } -#endif /* NO_JOGSHUTTLE */ +#endif /* USE_JOGSHUTTLE */ void KdenliveSettingsDialog::updateWidgets() { // Revert widgets to last saved state (for example when user pressed "Cancel") // kDebug() << "// // // KCONFIG Revert called"; -#ifndef NO_JOGSHUTTLE +#ifdef USE_JOGSHUTTLE // revert jog shuttle device if (m_configShuttle.shuttledevicelist->count() > 0) { for (int i = 0; i < m_configShuttle.shuttledevicelist->count(); i++) { @@ -573,7 +573,7 @@ void KdenliveSettingsDialog::updateWidgets() if (i < actions_map.size()) button->setCurrentIndex(action_pos[actions_map[i]]); } -#endif +#endif /* USE_JOGSHUTTLE */ } void KdenliveSettingsDialog::updateSettings() @@ -698,7 +698,7 @@ void KdenliveSettingsDialog::updateSettings() saveTranscodeProfiles(); } -#ifndef NO_JOGSHUTTLE +#ifdef USE_JOGSHUTTLE m_shuttleModified = false; QStringList actions; @@ -790,7 +790,7 @@ void KdenliveSettingsDialog::slotDeleteTranscode() void KdenliveSettingsDialog::slotShuttleModified() { -#ifndef NO_JOGSHUTTLE +#ifdef USE_JOGSHUTTLE QStringList actions; actions << "monitor_pause"; // the Job rest position action. foreach (KComboBox* button, m_shuttle_buttons) { diff --git a/src/kdenlivesettingsdialog.h b/src/kdenlivesettingsdialog.h index 6334af20..8c01c3fb 100644 --- a/src/kdenlivesettingsdialog.h +++ b/src/kdenlivesettingsdialog.h @@ -53,10 +53,10 @@ protected slots: private slots: void slotUpdateDisplay(); -#ifndef NO_JOGSHUTTLE +#ifdef USE_JOGSHUTTLE void slotCheckShuttle(int state = 0); void slotUpdateShuttleDevice(int ix = 0); -#endif /* NO_JOGSHUTTLE */ +#endif void slotEditImageApplication(); void slotEditAudioApplication(); void slotEditVideoApplication(); diff --git a/src/kiss_fft/kiss_fft.h b/src/kiss_fft/kiss_fft.h index 82597e58..8f94b077 100644 --- a/src/kiss_fft/kiss_fft.h +++ b/src/kiss_fft/kiss_fft.h @@ -1,11 +1,13 @@ #ifndef KISS_FFT_H #define KISS_FFT_H +#include "kdenlive-config.h" + #include #include #include #include -#if !defined(__APPLE__) && !defined(__FreeBSD__) +#ifdef HAVE_MALLOC_H #include #endif diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index e2bb83a0..f41a7fb1 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -40,11 +40,11 @@ #include "renderwidget.h" #include "renderer.h" #include "audiosignal.h" -#ifndef NO_JOGSHUTTLE +#ifdef USE_JOGSHUTTLE #include "jogshuttle.h" #include "jogaction.h" #include "jogshuttleconfig.h" -#endif /* NO_JOGSHUTTLE */ +#endif #include "clipproperties.h" #include "wizard.h" #include "commands/editclipcommand.h" @@ -137,10 +137,10 @@ MainWindow::MainWindow(const QString &MltPath, const KUrl & Url, const QString & m_activeTimeline(NULL), m_recMonitor(NULL), m_renderWidget(NULL), -#ifndef NO_JOGSHUTTLE +#ifdef USE_JOGSHUTTLE m_jogProcess(NULL), m_jogShuttle(NULL), -#endif /* NO_JOGSHUTTLE */ +#endif m_findActivated(false), m_stopmotion(NULL) { @@ -219,7 +219,7 @@ MainWindow::MainWindow(const QString &MltPath, const KUrl & Url, const QString & connect(m_recMonitor, SIGNAL(addProjectClip(KUrl)), this, SLOT(slotAddProjectClip(KUrl))); connect(m_recMonitor, SIGNAL(addProjectClipList(KUrl::List)), this, SLOT(slotAddProjectClipList(KUrl::List))); connect(m_recMonitor, SIGNAL(showConfigDialog(int, int)), this, SLOT(slotPreferences(int, int))); -#endif +#endif /* ! Q_WS_MAC */ m_monitorManager->initMonitors(m_clipMonitor, m_projectMonitor, m_recMonitor); m_notesDock = new QDockWidget(i18n("Project Notes"), this); @@ -598,9 +598,9 @@ MainWindow::MainWindow(const QString &MltPath, const KUrl & Url, const QString & m_projectList->slotAddClip(urls); } -#ifndef NO_JOGSHUTTLE +#ifdef USE_JOGSHUTTLE activateShuttleDevice(); -#endif /* NO_JOGSHUTTLE */ +#endif m_projectListDock->raise(); actionCollection()->addAssociatedWidget(m_clipMonitor->container()); @@ -812,7 +812,7 @@ void MainWindow::slotReloadEffects() m_effectList->reloadEffectList(m_effectsMenu, m_effectActions); } -#ifndef NO_JOGSHUTTLE +#ifdef USE_JOGSHUTTLE void MainWindow::activateShuttleDevice() { delete m_jogShuttle; @@ -830,7 +830,7 @@ void MainWindow::activateShuttleDevice() connect(m_jogShuttle, SIGNAL(forward(double)), m_monitorManager, SLOT(slotForward(double))); connect(m_jogShuttle, SIGNAL(action(const QString&)), this, SLOT(slotDoAction(const QString&))); } -#endif /* NO_JOGSHUTTLE */ +#endif /* USE_JOGSHUTTLE */ void MainWindow::slotDoAction(const QString& action_name) { @@ -2243,7 +2243,7 @@ void MainWindow::slotEditProjectSettings() if (w->exec() == QDialog::Accepted) { QString profile = w->selectedProfile(); m_activeDocument->setProjectFolder(w->selectedFolder()); -#ifndef Q_WS_MAC +#ifndef Q_WS_MAC m_recMonitor->slotUpdateCaptureFolder(m_activeDocument->projectFolder().path(KUrl::AddTrailingSlash)); #endif if (m_renderWidget) m_renderWidget->setDocumentPath(m_activeDocument->projectFolder().path(KUrl::AddTrailingSlash)); @@ -2587,7 +2587,7 @@ void MainWindow::connectDocument(TrackView *trackView, KdenliveDoc *doc) //cha m_activeDocument = doc; m_activeTimeline->updateProjectFps(); m_activeDocument->checkProjectClips(); -#ifndef Q_WS_MAC +#ifndef Q_WS_MAC m_recMonitor->slotUpdateCaptureFolder(m_activeDocument->projectFolder().path(KUrl::AddTrailingSlash)); #endif //Update the mouse position display so it will display in DF/NDF format by default based on the project setting. @@ -2654,7 +2654,7 @@ void MainWindow::slotPreferences(int page, int option) void MainWindow::slotUpdateCaptureFolder() { -#ifndef Q_WS_MAC +#ifndef Q_WS_MAC if (m_activeDocument) m_recMonitor->slotUpdateCaptureFolder(m_activeDocument->projectFolder().path(KUrl::AddTrailingSlash)); else m_recMonitor->slotUpdateCaptureFolder(KdenliveSettings::defaultprojectfolder()); #endif @@ -2677,9 +2677,9 @@ void MainWindow::updateConfiguration() // Update list of transcoding profiles loadTranscoders(); -#ifndef NO_JOGSHUTTLE +#ifdef USE_JOGSHUTTLE activateShuttleDevice(); -#endif /* NO_JOGSHUTTLE */ +#endif } diff --git a/src/mainwindow.h b/src/mainwindow.h index 075132f2..b2232914 100644 --- a/src/mainwindow.h +++ b/src/mainwindow.h @@ -59,10 +59,10 @@ class Monitor; class RecMonitor; class CustomTrackView; class RenderWidget; -#ifndef NO_JOGSHUTTLE +#ifdef USE_JOGSHUTTLE class JogShuttle; class JogShuttleAction; -#endif /* NO_JOGSHUTTLE */ +#endif class DocClipBase; class Render; class Transition; @@ -222,10 +222,10 @@ private: RenderWidget *m_renderWidget; -#ifndef NO_JOGSHUTTLE +#ifdef USE_JOGSHUTTLE JogShuttle *m_jogProcess; JogShuttleAction* m_jogShuttle; -#endif /* NO_JOGSHUTTLE */ +#endif KRecentFilesAction *m_fileOpenRecent; KAction *m_fileRevert; @@ -267,9 +267,9 @@ private: void readOptions(); void saveOptions(); -#ifndef NO_JOGSHUTTLE +#ifdef USE_JOGSHUTTLE void activateShuttleDevice(); -#endif /* NO_JOGSHUTTLE */ +#endif void connectDocumentInfo(KdenliveDoc *doc); void findAhead(); void doOpenFile(const KUrl &url, KAutoSaveFile *stale); diff --git a/src/monitor.cpp b/src/monitor.cpp index d28bd941..1090112d 100644 --- a/src/monitor.cpp +++ b/src/monitor.cpp @@ -155,7 +155,7 @@ Monitor::Monitor(QString name, MonitorManager *manager, QString profile, QWidget createOpenGlWidget(m_videoBox, profile); monitorCreated = true; //m_glWidget->setFixedSize(width, height); -#elif defined (USE_OPEN_GL) +#elif defined(USE_OPENGL) if (KdenliveSettings::openglmonitors()) { monitorCreated = createOpenGlWidget(m_videoBox, profile); } @@ -169,7 +169,7 @@ Monitor::Monitor(QString name, MonitorManager *manager, QString profile, QWidget render = new Render(m_name, (int) m_monitorRefresh->winId(), profile, this); m_monitorRefresh->setRenderer(render); } -#if defined (USE_OPEN_GL) +#ifdef USE_OPENGL else if (m_glWidget) { lay->addWidget(m_glWidget); m_videoBox->setLayout(lay); @@ -229,7 +229,7 @@ const QString Monitor::name() const return m_name; } -#if defined(Q_WS_MAC) || defined(USE_OPEN_GL) +#ifdef USE_OPENGL bool Monitor::createOpenGlWidget(QWidget *parent, const QString profile) { render = new Render(m_name, 0, profile, this); @@ -912,7 +912,7 @@ void Monitor::slotSwitchMonitorInfo(bool show) if (m_overlay) return; if (m_monitorRefresh == NULL) { // Using OpenGL display -#if defined(Q_WS_MAC) || defined(USE_OPEN_GL) +#ifdef USE_OPENGL if (m_glWidget->layout()) delete m_glWidget->layout(); m_overlay = new Overlay(); connect(m_overlay, SIGNAL(editMarker()), this, SLOT(slotEditMarker())); @@ -992,7 +992,7 @@ void Monitor::slotEffectScene(bool show) if (m_monitorRefresh) { m_monitorRefresh->setVisible(!show); } else { -#if defined(Q_WS_MAC) || defined(USE_OPEN_GL) +#ifdef USE_OPENGL m_glWidget->setVisible(!show); #endif } diff --git a/src/monitor.h b/src/monitor.h index 527935e4..ba949ff0 100644 --- a/src/monitor.h +++ b/src/monitor.h @@ -25,7 +25,7 @@ #include "renderer.h" #include "timecodedisplay.h" #include "abstractmonitor.h" -#if defined(Q_WS_MAC) || defined(USE_OPEN_GL) +#ifdef USE_OPENGL #include "videoglwidget.h" #endif @@ -170,7 +170,7 @@ private: * Necessary because sometimes we get two signals, e.g. we get a clip and we get selected transition = NULL. */ bool m_loopClipTransition; -#if defined(Q_WS_MAC) || defined(USE_OPEN_GL) +#ifdef USE_OPENGL VideoGLWidget *m_glWidget; bool createOpenGlWidget(QWidget *parent, const QString profile); #endif diff --git a/src/stopmotion/stopmotion.cpp b/src/stopmotion/stopmotion.cpp index 395c52f5..f3251fa6 100644 --- a/src/stopmotion/stopmotion.cpp +++ b/src/stopmotion/stopmotion.cpp @@ -17,7 +17,7 @@ #include "stopmotion.h" #include "blackmagic/devices.h" -#if !defined(Q_OS_FREEBSD) && !defined(Q_OS_KFREEBSD) +#ifdef USE_V4L #include "v4l/v4lcapture.h" #endif #include "slideshowclip.h" @@ -256,7 +256,7 @@ StopmotionWidget::StopmotionWidget(MonitorManager *manager, KUrl projectFolder, // Found a BlackMagic device } if (QFile::exists(KdenliveSettings::video4vdevice())) { -#if !defined(Q_WS_MAC) && !defined(Q_OS_FREEBSD) && !defined(Q_OS_KFREEBSD) +#ifdef USE_V4L // Video 4 Linux device detection for (int i = 0; i < 10; i++) { QString path = "/dev/video" + QString::number(i); @@ -270,7 +270,7 @@ StopmotionWidget::StopmotionWidget(MonitorManager *manager, KUrl projectFolder, } } } -#endif +#endif /* USE_V4L */ } connect(capture_device, SIGNAL(currentIndexChanged(int)), this, SLOT(slotUpdateDeviceHandler())); @@ -399,7 +399,7 @@ void StopmotionWidget::slotUpdateDeviceHandler() } m_layout->removeWidget(m_frame_preview); if (data == "v4l") { -#if !defined(Q_WS_MAC) && !defined(Q_OS_FREEBSD) && !defined(Q_OS_KFREEBSD) +#ifdef USE_V4L m_bmCapture = new V4lCaptureHandler(m_layout); m_bmCapture->setDevice(capture_device->itemData(capture_device->currentIndex(), Qt::UserRole + 1).toString(), capture_device->itemData(capture_device->currentIndex(), Qt::UserRole + 2).toString()); #endif diff --git a/src/v4l/v4lcapture.h b/src/v4l/v4lcapture.h index 56dbb589..0ca337e6 100644 --- a/src/v4l/v4lcapture.h +++ b/src/v4l/v4lcapture.h @@ -19,9 +19,7 @@ #ifndef __V4LCAPTUREHANDLER_H__ #define __V4LCAPTUREHANDLER_H__ -#ifndef __APPLE__ #include "src.h" -#endif #include #include diff --git a/src/wizard.cpp b/src/wizard.cpp index 7a8c12ef..a4d40078 100644 --- a/src/wizard.cpp +++ b/src/wizard.cpp @@ -20,7 +20,7 @@ #include "wizard.h" #include "kdenlivesettings.h" #include "profilesdialog.h" -#if !defined(Q_OS_FREEBSD) && !defined(Q_OS_KFREEBSD) +#ifdef USE_V4L #include "v4l/v4lcapture.h" #endif #include "kdenlive-config.h" @@ -158,7 +158,7 @@ Wizard::Wizard(bool upgrade, QWidget *parent) : void Wizard::slotDetectWebcam() { -#if !defined(Q_WS_MAC) && !defined(Q_OS_FREEBSD) && !defined(Q_OS_KFREEBSD) +#ifdef USE_V4L m_capture.v4l_devices->blockSignals(true); m_capture.v4l_devices->clear(); @@ -189,7 +189,7 @@ void Wizard::slotDetectWebcam() if (!found) m_capture.v4l_devices->setCurrentIndex(0); } else m_capture.v4l_status->setText(i18n("No device found, plug your webcam and refresh.")); m_capture.v4l_devices->blockSignals(false); -#endif +#endif /* USE_V4L */ } void Wizard::slotUpdateCaptureParameters()