Warning, /multimedia/kdenlive/src/CMakeLists.txt is written in an unsupported language. File is not indexed.

0001 # SPDX-FileCopyrightText: 2007 Kdenlive contributors
0002 # SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL
0003 
0004 
0005 ### Find packages files
0006 find_package(LibV4L2)
0007 set_package_properties(LibV4L2 PROPERTIES
0008     DESCRIPTION "video4linux support libraries"
0009     URL "https://linuxtv.org/downloads/v4l-utils/"
0010     TYPE RUNTIME
0011     PURPOSE "Required for better webcam support")
0012 
0013 if(WIN32)
0014     set(MLT_MELTBIN "melt.exe")
0015     set(MLT_DATADIR "../share/mlt")
0016 elseif(APPLE)
0017     set(MLT_MELTBIN "melt")
0018     set(MLT_DATADIR "../Resources/mlt")
0019 else()
0020     find_package(PkgConfig QUIET)
0021     execute_process(
0022         COMMAND ${PKG_CONFIG_EXECUTABLE} --variable=mltdatadir mlt-framework-7
0023         OUTPUT_VARIABLE MLT_DATADIR
0024         RESULT_VARIABLE MLT_DATADIR_failed)
0025     if(NOT MLT_DATADIR_failed)
0026         string(REGEX REPLACE "[\r\n]" "" MLT_DATADIR "${MLT_DATADIR}")
0027     endif()
0028 
0029     execute_process(
0030         COMMAND ${PKG_CONFIG_EXECUTABLE} --variable=meltbin mlt-framework-7
0031         OUTPUT_VARIABLE MLT_MELTBIN
0032         RESULT_VARIABLE MLT_MELTBIN_failed)
0033     if(NOT MLT_MELTBIN_failed)
0034         string(REGEX REPLACE "[\r\n]" "" MLT_MELTBIN "${MLT_MELTBIN}")
0035     endif()
0036 endif()
0037 configure_file(mlt_config.h.in ${CMAKE_BINARY_DIR}/mlt_config.h)
0038 
0039 check_include_files(linux/input.h HAVE_LINUX_INPUT_H)
0040 if(HAVE_LINUX_INPUT_H)
0041     list(APPEND kdenlive_SRCS
0042         jogshuttle/jogmanager.cpp
0043         jogshuttle/jogaction.cpp
0044         jogshuttle/jogshuttle.cpp
0045         jogshuttle/jogshuttleconfig.cpp)
0046 endif()
0047 
0048 ### Find source files
0049 add_subdirectory(abstractmodel)
0050 add_subdirectory(assets)
0051 add_subdirectory(audiomixer)
0052 add_subdirectory(bin)
0053 add_subdirectory(capture)
0054 add_subdirectory(dialogs)
0055 add_subdirectory(doc)
0056 add_subdirectory(effects)
0057 add_subdirectory(jobs)
0058 add_subdirectory(lib)
0059 add_subdirectory(library)
0060 add_subdirectory(mltcontroller)
0061 add_subdirectory(monitor)
0062 add_subdirectory(onlineresources)
0063 add_subdirectory(profiles)
0064 add_subdirectory(project)
0065 add_subdirectory(pythoninterfaces)
0066 add_subdirectory(render)
0067 add_subdirectory(renderpresets)
0068 add_subdirectory(scopes)
0069 add_subdirectory(timeline2)
0070 add_subdirectory(titler)
0071 add_subdirectory(transitions)
0072 add_subdirectory(utils)
0073 add_subdirectory(widgets)
0074 add_subdirectory(xml)
0075 
0076 ## toplevel source code files
0077 list(APPEND kdenlive_SRCS
0078     core.cpp
0079     definitions.cpp
0080     docktitlebarmanager.cpp
0081     layoutmanagement.cpp
0082     mainwindow.cpp
0083     mltconnection.cpp
0084     statusbarmessagelabel.cpp
0085     undohelper.cpp
0086     glaxnimatelauncher.cpp
0087 )
0088 
0089 if(CRASH_AUTO_TEST)
0090     list(APPEND kdenlive_SRCS logger.cpp)
0091 endif()
0092 
0093 ## Others special cases
0094 kconfig_add_kcfg_files(kdenlive_SRCS kdenlivesettings.kcfgc)
0095 install(FILES kdenlivesettings.kcfg DESTINATION ${KDE_INSTALL_KCFGDIR})
0096 ecm_qt_declare_logging_category(kdenlive_SRCS
0097     HEADER kdenlive_debug.h
0098     IDENTIFIER KDENLIVE_LOG
0099     CATEGORY_NAME org.kde.multimedia.kdenlive
0100     DESCRIPTION "kdenlive"
0101     EXPORT KDENLIVE
0102 )
0103 
0104 if(NOT NODBUS)
0105     if(USE_VERSIONLESS_TARGETS)
0106         qt_add_dbus_adaptor(kdenlive_SRCS org.kdenlive.MainWindow.xml mainwindow.h MainWindow)
0107     else()
0108         qt5_add_dbus_adaptor(kdenlive_SRCS org.kdenlive.MainWindow.xml mainwindow.h MainWindow)
0109     endif()
0110 endif()
0111 
0112 ## UI's
0113 file(GLOB kdenlive_UIS "ui/*.ui")
0114 ki18n_wrap_ui(kdenlive_UIS ${kdenlive_UIS})
0115 
0116 ## MOC
0117 if(USE_VERSIONLESS_TARGETS)
0118     qt_wrap_cpp(kdenlive_MOC definitions.h)
0119 else()
0120     qt5_wrap_cpp(kdenlive_MOC definitions.h)
0121 endif()
0122 set_property(SOURCE definitions.h PROPERTY SKIP_AUTOMOC ON)
0123 
0124 add_library(kdenliveLib STATIC ${kdenlive_SRCS} ${kdenlive_UIS} ${kdenlive_MOC} lib/localeHandling.cpp lib/localeHandling.h)
0125 
0126 if(USE_VERSIONLESS_TARGETS)
0127     qt_add_resources(kdenlive_extra_SRCS icons.qrc uiresources.qrc)
0128 else()
0129     qt5_add_resources(kdenlive_extra_SRCS icons.qrc uiresources.qrc)
0130 endif()
0131 
0132 ## Icon for Windows and OSX
0133 file(GLOB ICONS_SRCS "${CMAKE_CURRENT_SOURCE_DIR}/../data/icons/*-apps-kdenlive.png")
0134 ecm_add_app_icon(kdenlive ICONS ${ICONS_SRCS}) # icon name = variable name
0135 
0136 ## Kdenlive Executable
0137 add_executable(kdenlive main.cpp ${kdenlive_extra_SRCS} ${kdenlive})
0138 target_include_directories(kdenlive
0139     PRIVATE ${CMAKE_BINARY_DIR}
0140     )
0141 target_include_directories(kdenlive
0142         SYSTEM PRIVATE ${MLT_INCLUDE_DIR} ${MLTPP_INCLUDE_DIR})
0143 target_link_libraries(kdenlive kdenliveLib)
0144 install(TARGETS kdenlive DESTINATION ${KDE_INSTALL_BINDIR})
0145 
0146 ## Kdenlive Lib
0147 target_include_directories(kdenliveLib
0148     PRIVATE ${CMAKE_BINARY_DIR}
0149     ${CMAKE_CURRENT_SOURCE_DIR}
0150     ${CMAKE_CURRENT_SOURCE_DIR}/lib/external
0151     ${CMAKE_CURRENT_SOURCE_DIR}/lib
0152     )
0153 target_include_directories(kdenliveLib
0154         SYSTEM  PRIVATE ${MLT_INCLUDE_DIR} ${MLTPP_INCLUDE_DIR})
0155 # Adds Qt definitions and include directories, and sets QT_LIBRARIES according
0156 # to the components requested in find_package().
0157 # KDE definitions and include directories *must* always come first, Qt follows
0158 # (to avoid breaking builds when KDE and/or Qt are installed to different
0159 # prefixes).
0160 target_link_libraries(kdenliveLib
0161     KF${KF_MAJOR}::WidgetsAddons
0162     KF${KF_MAJOR}::Archive
0163     KF${KF_MAJOR}::CoreAddons
0164     KF${KF_MAJOR}::KIOCore
0165     KF${KF_MAJOR}::Codecs
0166     KF${KF_MAJOR}::KIOFileWidgets
0167     KF${KF_MAJOR}::KIOWidgets
0168     KF${KF_MAJOR}::NotifyConfig
0169     KF${KF_MAJOR}::XmlGui
0170     KF${KF_MAJOR}::GuiAddons
0171     KF${KF_MAJOR}::Notifications
0172     KF${KF_MAJOR}::TextWidgets
0173     KF${KF_MAJOR}::IconThemes
0174     KF${KF_MAJOR}::Solid
0175     KF${KF_MAJOR}::FileMetaData
0176     KF${KF_MAJOR}::Purpose
0177     KF${KF_MAJOR}::PurposeWidgets
0178     ${OPENGL_LIBRARIES}
0179     ${OPENGLES_LIBRARIES}
0180     ${MLT_LIBRARIES}
0181     ${MLTPP_LIBRARIES}
0182     ${CMAKE_DL_LIBS}
0183     ${CMAKE_THREAD_LIBS_INIT}
0184     kiss_fft)
0185 
0186 if(KF${KF_MAJOR}NewStuff_VERSION VERSION_LESS "5.90")
0187     target_link_libraries(kdenliveLib
0188         KF${KF_MAJOR}::NewStuff)
0189 else()
0190     target_link_libraries(kdenliveLib
0191         KF${KF_MAJOR}::NewStuffWidgets)
0192 endif()
0193 
0194 if (KF_MAJOR LESS "6")
0195     target_link_libraries(kdenliveLib
0196         KF${KF_MAJOR}::Declarative)
0197 endif()
0198 
0199 if(USE_VERSIONLESS_TARGETS)
0200     target_link_libraries(kdenliveLib
0201         Qt::Svg
0202         Qt::Quick
0203         Qt::QuickControls2
0204         Qt::QuickWidgets
0205         Qt::Concurrent
0206         Qt::Multimedia
0207         Qt::NetworkAuth)
0208 else()
0209     target_link_libraries(kdenliveLib
0210         Qt${QT_MAJOR_VERSION}::Svg
0211         Qt${QT_MAJOR_VERSION}::Quick
0212         Qt${QT_MAJOR_VERSION}::QuickControls2
0213         Qt${QT_MAJOR_VERSION}::QuickWidgets
0214         Qt${QT_MAJOR_VERSION}::Concurrent
0215         Qt${QT_MAJOR_VERSION}::Multimedia
0216         Qt${QT_MAJOR_VERSION}::NetworkAuth)
0217 endif()
0218 if (QT_MAJOR_VERSION STREQUAL "6")
0219     target_link_libraries(kdenliveLib Qt${QT_MAJOR_VERSION}::SvgWidgets)
0220 endif()
0221 
0222 if(WIN32 AND QT_MAJOR_VERSION STREQUAL "6")
0223     target_link_libraries(kdenliveLib d3d11 d3dcompiler)
0224 endif()
0225 
0226 if(NOT NODBUS)
0227   target_link_libraries(kdenliveLib KF${KF_MAJOR}::DBusAddons)
0228 endif()
0229 if(BUILD_COVERAGE)
0230   target_link_libraries(kdenliveLib gcov)
0231 endif()
0232 set_property(TARGET kdenliveLib PROPERTY CXX_STANDARD 14)
0233 add_definitions(${qt${QT_MAJOR_VERSION}gui_definitions} -DQT_STRICT_ITERATORS -DQT_NO_CAST_FROM_BYTEARRAY)
0234 
0235 # Optional deps
0236 if(CRASH_AUTO_TEST)
0237     target_compile_definitions(kdenliveLib PRIVATE CRASH_AUTO_TEST)
0238     if(TARGET RTTR::Core)
0239         target_link_libraries(kdenliveLib RTTR::Core)
0240     else()
0241         target_link_libraries(kdenliveLib RTTR::Core_Lib)
0242     endif()
0243 endif()
0244 
0245 if(DRMINGW_FOUND)
0246     target_compile_definitions(kdenlive PRIVATE -DUSE_DRMINGW)
0247     target_include_directories(kdenlive SYSTEM PRIVATE ${DRMINGW_INCLUDE_DIR})
0248     target_link_libraries(kdenlive ${DRMINGW_LIBRARY})
0249 elseif(KF${KF_MAJOR}Crash_FOUND)
0250     target_compile_definitions(kdenlive PRIVATE -DKF5_USE_CRASH)
0251     target_link_libraries(kdenlive KF${KF_MAJOR}::Crash)
0252 endif()
0253 
0254 if(Q_WS_X11)
0255         target_include_directories(kdenliveLib SYSTEM PRIVATE ${X11_Xlib_INCLUDE_PATH})
0256     target_link_libraries(kdenliveLib ${X11_LIBRARIES})
0257 endif()
0258 
0259 if(SDL2_FOUND)
0260     target_link_libraries(kdenliveLib ${SDL2_LIBRARY})
0261 elseif(SDL_FOUND)
0262     target_link_libraries(kdenliveLib ${SDL_LIBRARY})
0263 endif()
0264 
0265 if(LIBV4L2_FOUND)
0266     target_include_directories(kdenliveLib SYSTEM PRIVATE ${LIBV4L2_INCLUDE_DIR})
0267     target_link_libraries(kdenliveLib ${LIBV4L2_LIBRARY})
0268     target_compile_definitions(kdenliveLib PRIVATE -DUSE_V4L)
0269 endif()
0270 
0271 if(HAVE_LINUX_INPUT_H)
0272     target_compile_definitions(kdenliveLib PRIVATE -DUSE_JOGSHUTTLE)
0273     target_link_libraries(kdenliveLib media_ctrl)
0274 endif()
0275 
0276 if(APPLE)
0277     set_target_properties(kdenlive PROPERTIES MACOSX_BUNDLE ON)
0278 endif()
0279 
0280 
0281 if(NODBUS)
0282     target_compile_definitions(kdenliveLib PRIVATE -DNODBUS)
0283     target_compile_definitions(kdenlive PRIVATE -DNODBUS)
0284 endif()
0285 
0286 if (BUILD_QCH)
0287     ecm_add_qch(
0288         Kdenlive_QCH
0289         NAME kdenlive
0290         VERSION ${KDENLIVE_VERSION}
0291         ORG_DOMAIN org.kde
0292         SOURCE_DIRS
0293             .
0294         MD_MAINPAGE "${CMAKE_SOURCE_DIR}/README.md"
0295         TAGFILE_INSTALL_DESTINATION ${KDE_INSTALL_QTQCHDIR}
0296         QCH_INSTALL_DESTINATION ${KDE_INSTALL_QTQCHDIR}
0297         COMPONENT Devel
0298     )
0299 endif()
0300