CMakeLists.txt 4.39 KB
Newer Older
1
project(Kdenlive)
Jean-Baptiste Mardelle's avatar
Jean-Baptiste Mardelle committed
2

3 4
# 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.
5 6

# KDE Application Version, managed by release script
7
set (KDE_APPLICATIONS_VERSION_MAJOR "17")
8
set (KDE_APPLICATIONS_VERSION_MINOR "04")
9
set (KDE_APPLICATIONS_VERSION_MICRO "3")
10 11

set(KDENLIVE_VERSION ${KDE_APPLICATIONS_VERSION_MAJOR}.${KDE_APPLICATIONS_VERSION_MINOR}.${KDE_APPLICATIONS_VERSION_MICRO})
Laurent Montel's avatar
Laurent Montel committed
12
cmake_minimum_required(VERSION 3.0)
Vincent Pinon's avatar
Vincent Pinon committed
13 14 15
if(POLICY CMP0063)
  cmake_policy(SET CMP0063 NEW)
endif()
Laurent Montel's avatar
Laurent Montel committed
16 17 18
if (POLICY CMP0053)
    cmake_policy(SET CMP0053 NEW)
endif()
19
# Minimum versions of main dependencies.
20
set(MLT_MIN_MAJOR_VERSION 6)
21
set(MLT_MIN_MINOR_VERSION 4)
22
set(MLT_MIN_PATCH_VERSION 0)
23
set(MLT_MIN_VERSION ${MLT_MIN_MAJOR_VERSION}.${MLT_MIN_MINOR_VERSION}.${MLT_MIN_PATCH_VERSION})
Jean-Baptiste Mardelle's avatar
Jean-Baptiste Mardelle committed
24

25
set(QT_MIN_VERSION 5.6.0)
26

27
find_package(ECM 5.18.0 REQUIRED CONFIG)
28 29 30 31 32 33 34
set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH} ${CMAKE_SOURCE_DIR}/cmake/modules)
include(FeatureSummary)
include(ECMInstallIcons)
include(GenerateExportHeader)
include(KDEInstallDirs)
include(KDECMakeSettings)
include(KDECompilerSettings)
35
include(ECMOptionalAddSubdirectory)
36 37
include(ECMMarkNonGuiExecutable)
include(ECMAddAppIcon)
Laurent Montel's avatar
Laurent Montel committed
38
include(ECMQtDeclareLoggingCategory)
Jean-Baptiste Mardelle's avatar
Jean-Baptiste Mardelle committed
39

40
add_definitions(-DQT_NO_CAST_TO_ASCII)
41
add_definitions(-DQT_NO_URL_CAST_FROM_STRING)
42
add_definitions(-DTRANSLATION_DOMAIN=\"kdenlive\")
43

44 45
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${ECM_MODULE_PATH})
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${Qt5Widgets_EXECUTABLE_COMPILE_FLAGS}")
46
# To be switched on when releasing.
47
option(RELEASE_BUILD "Remove Git revision from program version (use for stable releases)" ON)
48 49

# Get current version.
50 51 52 53 54 55 56
set(KDENLIVE_VERSION_STRING "${KDENLIVE_VERSION}")
if(NOT RELEASE_BUILD AND EXISTS ${CMAKE_SOURCE_DIR}/.git)
  # Probably a Git workspace; determine the revision.
  find_package(Git QUIET)
  if(GIT_FOUND)
    exec_program(${GIT_EXECUTABLE}
      ${CMAKE_SOURCE_DIR}
57
	ARGS "log -n 1 --pretty=format:\"%h\""
58 59 60
      OUTPUT_VARIABLE KDENLIVE_GIT_REVISION
      RETURN_VALUE TAG_RESULT
    )
61

62
    # git log failed; maybe the repository was checked with depth=1.
63
    if(NOT ${TAG_RESULT} EQUAL 0)
64
      exec_program(${GIT_EXECUTABLE}
65 66
        ${CMAKE_SOURCE_DIR}
        ARGS "describe --always"
67 68
        OUTPUT_VARIABLE KDENLIVE_GIT_REVISION
      )
69 70 71 72 73 74 75
    endif()
    message(STATUS "Kdenlive Git revision: ${KDENLIVE_GIT_REVISION}")
    set(KDENLIVE_VERSION_STRING "${KDENLIVE_VERSION} (rev. ${KDENLIVE_GIT_REVISION})")
  else()
    message(STATUS "Kdenlive Git revision could not be determined")
  endif()
endif()
76 77 78 79 80

include(CheckIncludeFiles)
check_include_files(malloc.h HAVE_MALLOC_H)
check_include_files(pthread.h HAVE_PTHREAD_H)

81 82
find_package(Qt5 REQUIRED COMPONENTS Core DBus Widgets Script Svg Quick )
find_package(Qt5 OPTIONAL_COMPONENTS WebKitWidgets QUIET)
83

84 85 86 87 88 89 90 91
find_package(KF5 5.23.0 OPTIONAL_COMPONENTS XmlGui QUIET)
if (KF5XmlGui_FOUND)
  message(STATUS "Found KF5 >= 5.23.0 enabling icon coloring")
else()
  message(STATUS "KF5 < 5.23.0 Disable icon coloring")
  set(KF5_ICON_COMPATIBILITY TRUE)
endif()

92
find_package(KF5 REQUIRED COMPONENTS Archive Bookmarks CoreAddons Config ConfigWidgets 
Vincent Pinon's avatar
Vincent Pinon committed
93 94
                            DBusAddons KIO WidgetsAddons NotifyConfig NewStuff XmlGui Notifications GuiAddons TextWidgets IconThemes Crash
                 OPTIONAL_COMPONENTS DocTools FileMetaData)
95 96 97 98 99 100 101

if (KF5FileMetaData_FOUND)
  message(STATUS "Found KF5 FileMetadata to extract file metadata")
  set(KF5_FILEMETADATA TRUE)
else()
  message(STATUS "KF5 FileMetadata not found, file metadata will not be available")
endif()
102

103
# Search MLT package.
104
find_package(MLT ${MLT_MIN_VERSION} REQUIRED)
105 106 107 108 109 110
set_package_properties(MLT PROPERTIES 
                DESCRIPTION "Multimedia framework and video playout server for TV broadcasting"
                URL "http://mltframework.org"
                TYPE RUNTIME
                PURPOSE "Required to do video processing")

111
set(MLT_PREFIX ${MLT_ROOT_DIR})
Jean-Baptiste Mardelle's avatar
Jean-Baptiste Mardelle committed
112

113
add_subdirectory(data)
114
if(KF5DocTools_FOUND)
Vincent Pinon's avatar
Vincent Pinon committed
115 116
    add_subdirectory(doc)
endif()
117
#add_subdirectory(plugins)
118
ecm_optional_add_subdirectory(po)
119 120
add_subdirectory(renderer)
add_subdirectory(src)
121
add_subdirectory(thumbnailer)
122
#add_subdirectory(testingArea)
123

124

Laurent Montel's avatar
Laurent Montel committed
125
install( FILES kdenlive.categories DESTINATION ${KDE_INSTALL_CONFDIR} )
126

127
configure_file(config-kdenlive.h.cmake config-kdenlive.h @ONLY)
Laurent Montel's avatar
Laurent Montel committed
128
feature_summary(WHAT ALL INCLUDE_QUIET_PACKAGES FATAL_ON_MISSING_REQUIRED_PACKAGES)