project(kdenlive)
+set(BASE_VERSION 0.8.1)
+set(LIBMLT_REQUIRED_VERSION 0.7)
-set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/modules )
+option(RELEASE_BUILD "Remove compilation date from program version (use for stable releases)" OFF)
+set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/modules)
-# search packages used by KDE
+# Search packages used by KDE.
find_package(KDE4 REQUIRED)
-include (KDE4Defaults)
-include (MacroLibrary)
+set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} --std=c99") # To compile kiss_fft
+include(KDE4Defaults)
+include(MacroLibrary)
+include(FindGettext)
include(MacroOptionalAddSubdirectory)
set(catalogname kdenlive)
+find_package(Qt COMPONENTS QtOpenGL)
+if ( NOT QT_QTOPENGL_FOUND )
+ message(FATAL_ERROR "QtOpenGL (most likely called libqt4-opengl-dev) not found.")
+else ( NOT QT_QTOPENGL_FOUND )
+ message(-- " Found QtOpenGL.")
+endif ( NOT QT_QTOPENGL_FOUND )
+find_library(Qt COMPONENTS QtOpenGL REQUIRED)
+add_definitions(${QT_DEFINITIONS})
-add_definitions (${QT_DEFINITIONS} ${KDE4_DEFINITIONS})
-include_directories (${QDBUS_INCLUDE_DIRS} ${CMAKE_SOURCE_DIR} ${CMAKE_BINARY_DIR} ${KDE4_INCLUDES} ${CMAKE_SOURCE_DIR}/widgets)
+# Search MLT package.
+find_package(LIBMLT REQUIRED)
+if(LIBMLT_VERSION VERSION_LESS ${LIBMLT_REQUIRED_VERSION})
+ message(FATAL_ERROR "MLT must be at least version ${LIBMLT_REQUIRED_VERSION}, you have ${LIBMLT_VERSION}\nPlease install recent MLT http://www.mltframework.org")
+endif(LIBMLT_VERSION VERSION_LESS ${LIBMLT_REQUIRED_VERSION})
-FIND_PACKAGE(LIBMLT REQUIRED)
-FIND_PACKAGE(LIBMLTPLUS REQUIRED)
-FIND_PACKAGE(LIBFFMPEG REQUIRED)
find_package(MSGFMT REQUIRED)
-
find_program(EXTRACTRC_EXECUTABLE extractrc)
find_program(MSGFMT_EXECUTABLE msgfmt)
find_program(MSGMERGE_EXECUTABLE msgmerge)
find_program(XGETTEXT_EXECUTABLE xgettext)
-
+# Get current version.
+if(RELEASE_BUILD)
+ set(VERSION "\"${BASE_VERSION}\"")
+else(RELEASE_BUILD)
+ if(EXISTS ${PROJECT_SOURCE_DIR}/.svn)
+ # Probably a SVN workspace: determine the revision.
+ find_package(Subversion)
+ if(Subversion_FOUND)
+ Subversion_WC_INFO(${PROJECT_SOURCE_DIR} KDENLIVE)
+ message("Current revision is ${KDENLIVE_WC_REVISION}")
+ set(VERSION "\"${BASE_VERSION} (rev. ${KDENLIVE_WC_REVISION})\"")
+ else(Subversion_FOUND)
+ message("Could not determine the SVN revision")
+ set(VERSION "\"${BASE_VERSION}\"")
+ endif(Subversion_FOUND)
+ else(EXISTS ${PROJECT_SOURCE_DIR}/.svn)
+ set(VERSION "\"${BASE_VERSION}\"")
+ endif(EXISTS ${PROJECT_SOURCE_DIR}/.svn)
+endif(RELEASE_BUILD)
add_subdirectory(src src/cmake_bindir)
add_subdirectory(renderer renderer/cmake_bindir)
-add_subdirectory(effects )
-add_subdirectory(export )
-add_subdirectory(icons )
-add_subdirectory(data )
-add_subdirectory(po)
\ No newline at end of file
+add_subdirectory(thumbnailer thumbnailer/cmake_bindir)
+add_subdirectory(plugins)
+add_subdirectory(effects)
+add_subdirectory(export)
+add_subdirectory(icons)
+add_subdirectory(data)
+add_subdirectory(lumas)
+add_subdirectory(titles)
+add_subdirectory(po)
+add_subdirectory(man)
+
+configure_file(${CMAKE_SOURCE_DIR}/kdenlive-config.h.cmake kdenlive-config.h @ONLY)
+
+
+message("-- C flags are now: " ${CMAKE_C_FLAGS})