CMakeLists.txt 3.49 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
set(KDENLIVE_VERSION 0.9.99)
cmake_minimum_required(VERSION 2.8.12)
7
# Minimum versions of main dependencies.
8
set(MLT_MIN_MAJOR_VERSION 0)
9 10
set(MLT_MIN_MINOR_VERSION 8)
set(MLT_MIN_PATCH_VERSION 8)
11
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
12

13 14 15 16 17 18 19 20 21 22 23
set(QT_MIN_VERSION 5.2.0)
#set(KDE_MIN_VERSION 4.3.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)
Jean-Baptiste Mardelle's avatar
Jean-Baptiste Mardelle committed
24

25 26
add_definitions(-DQT_NO_URL_CAST_FROM_STRING)

27 28 29
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${ECM_MODULE_PATH})
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${Qt5Widgets_EXECUTABLE_COMPILE_FLAGS}")
SET(CMAKE_CXX_FLAGS "-fPIC")
30
# To be switched on when releasing.
31
option(RELEASE_BUILD "Remove Git revision from program version (use for stable releases)" OFF)
32 33

# Get current version.
34 35 36 37 38 39 40 41 42 43 44 45 46
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}
      ARGS "describe --tags"
      OUTPUT_VARIABLE KDENLIVE_GIT_REVISION
      RETURN_VALUE TAG_RESULT
    )
    # git describe --tags failed; maybe the repository was checked with depth=1.
    if(NOT ${TAG_RESULT} EQUAL 0)
47
      exec_program(${GIT_EXECUTABLE}
48 49
        ${CMAKE_SOURCE_DIR}
        ARGS "describe --always"
50 51
        OUTPUT_VARIABLE KDENLIVE_GIT_REVISION
      )
52 53 54 55 56 57 58
    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()
59 60 61 62 63 64

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

# Search KDE and dependent packages.
65 66 67 68 69 70 71 72 73 74
#find_package(KDE4 ${KDE_MIN_VERSION} REQUIRED)
#include(KDE4Defaults)
#include(MacroLibrary)
#macro_log_feature(KDE4_FOUND
 # "KDELibs"
 # "KDE core libraries"
 # "http://www.kde.org"
 # TRUE
 # ${KDE_MIN_VERSION}
#)
75

76
# Find Qt core modules (QtCore and QtGui).
77 78 79 80 81
#find_package(Qt4 ${QT_MIN_VERSION} REQUIRED)

find_package(Qt5 CONFIG REQUIRED Core DBus Test Widgets Script Svg OpenGL)

find_package(KF5 REQUIRED Archive Bookmarks CoreAddons Config ConfigWidgets 
82
                            DBusAddons KIO WidgetsAddons Plotting NotifyConfig NewStuff XmlGui Notifications GuiAddons TextWidgets IconThemes )
83 84
                            #Service)

85

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

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

96
add_subdirectory(data)
97 98 99 100
#TODO: re-enable
#macro_optional_add_subdirectory(doc)
#add_subdirectory(plugins)
#macro_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)