CMakeLists.txt 3.84 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 7

# KDE Application Version, managed by release script
set (KDE_APPLICATIONS_VERSION_MAJOR "15")
8
set (KDE_APPLICATIONS_VERSION_MINOR "13")
9
set (KDE_APPLICATIONS_VERSION_MICRO "0")
10 11

set(KDENLIVE_VERSION ${KDE_APPLICATIONS_VERSION_MAJOR}.${KDE_APPLICATIONS_VERSION_MINOR}.${KDE_APPLICATIONS_VERSION_MICRO})
12
cmake_minimum_required(VERSION 2.8.12)
Vincent Pinon's avatar
Vincent Pinon committed
13 14 15
if(POLICY CMP0063)
  cmake_policy(SET CMP0063 NEW)
endif()
16
# Minimum versions of main dependencies.
17
set(MLT_MIN_MAJOR_VERSION 0)
Vincent Pinon's avatar
Vincent Pinon committed
18
set(MLT_MIN_MINOR_VERSION 9)
Jean-Baptiste Mardelle's avatar
Jean-Baptiste Mardelle committed
19
set(MLT_MIN_PATCH_VERSION 8)
20
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
21

22 23 24 25 26 27 28 29 30 31
set(QT_MIN_VERSION 5.2.0)

find_package(ECM 1.2.0 REQUIRED CONFIG)
set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH} ${CMAKE_SOURCE_DIR}/cmake/modules)
include(FeatureSummary)
include(ECMInstallIcons)
include(GenerateExportHeader)
include(KDEInstallDirs)
include(KDECMakeSettings)
include(KDECompilerSettings)
32
include(ECMOptionalAddSubdirectory)
Jean-Baptiste Mardelle's avatar
Jean-Baptiste Mardelle committed
33

34
add_definitions(-DQT_NO_URL_CAST_FROM_STRING)
35
add_definitions(-DTRANSLATION_DOMAIN=\"kdenlive\")
36

37 38
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${ECM_MODULE_PATH})
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${Qt5Widgets_EXECUTABLE_COMPILE_FLAGS}")
39
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC")
40
# To be switched on when releasing.
41
option(RELEASE_BUILD "Remove Git revision from program version (use for stable releases)" ON)
42 43

# Get current version.
44 45 46 47 48 49 50
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}
51
	ARGS "log -n 1 --pretty=format:\"%h\""
52 53 54
      OUTPUT_VARIABLE KDENLIVE_GIT_REVISION
      RETURN_VALUE TAG_RESULT
    )
55

56
    # git log failed; maybe the repository was checked with depth=1.
57
    if(NOT ${TAG_RESULT} EQUAL 0)
58
      exec_program(${GIT_EXECUTABLE}
59 60
        ${CMAKE_SOURCE_DIR}
        ARGS "describe --always"
61 62
        OUTPUT_VARIABLE KDENLIVE_GIT_REVISION
      )
63 64 65 66 67 68 69
    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()
70 71 72 73 74

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

75
find_package(Qt5 CONFIG REQUIRED Core DBus Test Widgets Script Svg Quick)
76

77
find_package(KF5 5.15 REQUIRED COMPONENTS Archive Bookmarks CoreAddons Config ConfigWidgets 
78 79 80 81 82 83 84 85
                            DBusAddons KIO WidgetsAddons Plotting NotifyConfig NewStuff XmlGui Notifications GuiAddons TextWidgets IconThemes DocTools Crash OPTIONAL_COMPONENTS FileMetaData)

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()
86

87
# Search MLT package.
88
find_package(MLT ${MLT_MIN_VERSION} REQUIRED)
89 90 91 92 93 94
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")

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

97
add_subdirectory(data)
98
add_subdirectory(doc)
99
#add_subdirectory(plugins)
100
ecm_optional_add_subdirectory(po)
101 102
add_subdirectory(renderer)
add_subdirectory(src)
103
add_subdirectory(thumbnailer)
104
#add_subdirectory(testingArea)
105

106

107

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