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

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