Commit cdb1c3a5 authored by Alberto Villa's avatar Alberto Villa Committed by Vincent PINON

Update FindMLT.cmake to adhere to CMake standards

Also, pass MLT_PREFIX via config-kdenlive.h.
Version checking is gained for free.

Conflicts:
	src/CMakeLists.txt
parent 1e5fae17
......@@ -5,7 +5,7 @@ project(kdenlive)
set(KDENLIVE_VERSION 0.9.7)
# Minimum versions of main dependencies.
set(LIBMLT_MIN_VERSION 0.8.8)
set(MLT_MIN_VERSION 0.8.8)
set(QT_MIN_VERSION 4.5.0)
set(KDE_MIN_VERSION 4.3.0)
......@@ -63,17 +63,15 @@ macro_log_feature(KDE4_FOUND
find_package(Qt4 ${QT_MIN_VERSION} REQUIRED)
# Search MLT package.
find_package(LIBMLT ${LIBMLT_MIN_VERSION} REQUIRED)
if(LIBMLT_VERSION VERSION_LESS ${LIBMLT_MIN_VERSION})
set(LIBMLT_FOUND FALSE)
endif(LIBMLT_VERSION VERSION_LESS ${LIBMLT_MIN_VERSION})
macro_log_feature(LIBMLT_FOUND
find_package(MLT ${MLT_MIN_VERSION} REQUIRED)
macro_log_feature(MLT_FOUND
"MLT"
"Multimedia framework and video playout server for TV broadcasting"
"http://mltframework.org"
TRUE
${LIBMLT_MIN_VERSION}
${MLT_MIN_VERSION}
)
set(MLT_PREFIX ${MLT_ROOT_DIR})
add_subdirectory(data)
macro_optional_add_subdirectory(doc)
......
#
# Find the MLT includes and libraries.
#
include(FindPkgConfig)
pkg_check_modules(MLT mlt++)
add_definitions(-DMLT_PREFIX=\\\"\"${MLT_PREFIX}\"\\\")
find_path(LIBMLT_INCLUDE_DIR
NAMES framework/mlt.h
PATHS
${MLT_INCLUDEDIR}/mlt
${MLT_PREFIX}/include/mlt
/usr/local/include/mlt
/usr/include/mlt
NO_DEFAULT_PATH
)
find_library(LIBMLT_LIBRARY
NAMES mlt
PATHS
${MLT_LIBDIR}
${MLT_PREFIX}/lib
/usr/local/lib
/usr/lib
NO_DEFAULT_PATH
)
find_path(LIBMLTPLUS_INCLUDE_DIR
NAMES mlt++/Mlt.h
PATHS
${MLT_INCLUDEDIR}
${MLT_PREFIX}/include
/usr/local/include
/usr/include
NO_DEFAULT_PATH
)
find_library(LIBMLTPLUS_LIBRARY
NAMES mlt++
PATHS
${MLT_LIBDIR}
${MLT_PREFIX}/lib
/usr/local/lib
/usr/lib
NO_DEFAULT_PATH
)
if(LIBMLT_LIBRARY AND LIBMLT_INCLUDE_DIR)
set(LIBMLT_FOUND 1)
set(LIBMLT_LIBRARIES ${LIBMLT_LIBRARY})
else(LIBMLT_LIBRARY AND LIBMLT_INCLUDE_DIR)
set(LIBMLT_FOUND 0)
endif(LIBMLT_LIBRARY AND LIBMLT_INCLUDE_DIR)
if(LIBMLT_FOUND AND LIBMLTPLUS_LIBRARY AND LIBMLTPLUS_INCLUDE_DIR)
set(LIBMLT_FOUND 1)
set(LIBMLTPLUS_LIBRARIES ${LIBMLTPLUS_LIBRARY})
else(LIBMLT_FOUND AND LIBMLTPLUS_LIBRARY AND LIBMLTPLUS_INCLUDE_DIR)
set(LIBMLT_FOUND 0)
endif(LIBMLT_FOUND AND LIBMLTPLUS_LIBRARY AND LIBMLTPLUS_INCLUDE_DIR)
if(LIBMLT_FOUND)
set(LIBMLT_VERSION ${MLT_VERSION})
if(NOT LIBMLT_FIND_QUIETLY)
message(STATUS "Found MLT++: ${LIBMLTPLUS_LIBRARY}")
endif(NOT LIBMLT_FIND_QUIETLY)
else(LIBMLT_FOUND)
if(LIBMLT_FIND_REQUIRED)
message(FATAL_ERROR "Could not find MLT++")
endif(LIBMLT_FIND_REQUIRED)
endif(LIBMLT_FOUND)
# - Find the MLT includes and libraries
find_package(PkgConfig QUIET)
pkg_check_modules(PC_MLT QUIET mlt++)
find_path(MLT_INCLUDE_DIR
NAMES framework/mlt.h
HINTS
${PC_MLT_INCLUDEDIR}
${PC_MLT_PREFIX}/include
PATHS
/usr/local/include
/usr/include
PATH_SUFFIXES mlt
)
find_library(MLT_LIBRARIES
NAMES mlt
HINTS
${PC_MLT_LIBDIR}
${PC_MLT_PREFIX}/lib
PATHS
/usr/local/lib
/usr/lib
)
find_path(MLTPP_INCLUDE_DIR
NAMES mlt++/Mlt.h
HINTS
${PC_MLT_INCLUDEDIR}
${PC_MLT_PREFIX}/include
PATHS
/usr/local/include
/usr/include
)
find_library(MLTPP_LIBRARIES
NAMES mlt++
HINTS
${PC_MLT_LIBDIR}
${PC_MLT_PREFIX}/lib
PATHS
/usr/local/lib
/usr/lib
)
get_filename_component(MLT_ROOT_DIR ${MLTPP_INCLUDE_DIR} PATH)
if(PC_MLT_VERSION)
set(MLT_VERSION_STRING ${PC_MLT_VERSION})
endif()
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(MLT
REQUIRED_VARS MLT_LIBRARIES MLTPP_LIBRARIES MLT_INCLUDE_DIR MLTPP_INCLUDE_DIR
VERSION_VAR MLT_VERSION_STRING
)
mark_as_advanced(MLT_INCLUDE_DIR MLT_LIBRARIES MLTPP_INCLUDE_DIR MLTPP_LIBRARIES)
......@@ -3,6 +3,8 @@
#cmakedefine VERSION @VERSION@
#define MLT_PREFIX "@MLT_PREFIX@"
#cmakedefine HAVE_MALLOC_H 1
#cmakedefine HAVE_PTHREAD_H 1
......
......@@ -293,8 +293,8 @@ add_definitions(${KDE4_DEFINITIONS})
include_directories(
${CMAKE_BINARY_DIR}
${KDE4_INCLUDES} # Adds Qt include directories too.
${LIBMLT_INCLUDE_DIR}
${LIBMLTPLUS_INCLUDE_DIR}
${MLT_INCLUDE_DIR}
${MLTPP_INCLUDE_DIR}
${CMAKE_CURRENT_SOURCE_DIR}/lib/external
${CMAKE_CURRENT_SOURCE_DIR}/lib
)
......@@ -318,8 +318,8 @@ target_link_libraries(kdenlive
${KDE4_KROSSUI_LIBS}
${KDE4_SOLID_LIBS}
${QT_LIBRARIES}
${LIBMLT_LIBRARY}
${LIBMLTPLUS_LIBRARY}
${MLT_LIBRARIES}
${MLTPP_LIBRARIES}
${CMAKE_DL_LIBS}
${CMAKE_THREAD_LIBS_INIT}
kiss_fft
......
......@@ -3,8 +3,8 @@ message(STATUS "Building experimental executables")
include_directories(
${CMAKE_BINARY_DIR}
${LIBMLT_INCLUDE_DIR}
${LIBMLTPLUS_INCLUDE_DIR}
${MLT_INCLUDE_DIR}
${MLTPP_INCLUDE_DIR}
${PROJECT_SOURCE_DIR}/src/lib/extern/kiss_fft
${PROJECT_SOURCE_DIR}/src/lib/extern/kiss_fft/tools
)
......@@ -21,7 +21,7 @@ add_executable(audioOffset
)
target_link_libraries(audioOffset
${QT_LIBRARIES}
${LIBMLT_LIBRARY}
${LIBMLTPLUS_LIBRARY}
${MLT_LIBRARIES}
${MLTPP_LIBRARIES}
kiss_fft
)
......@@ -2,8 +2,8 @@ set(westleypreview_SRCS westleypreview.cpp)
include_directories(
${KDE4_INCLUDES}
${LIBMLT_INCLUDE_DIR}
${LIBMLTPLUS_INCLUDE_DIR}
${MLT_INCLUDE_DIR}
${MLTPP_INCLUDE_DIR}
)
kde4_add_plugin(westleypreview ${westleypreview_SRCS})
......@@ -13,8 +13,8 @@ include(${QT_USE_FILE})
target_link_libraries(westleypreview
${KDE4_KIO_LIBS}
${QT_LIBRARIES}
${LIBMLT_LIBRARY}
${LIBMLTPLUS_LIBRARY}
${MLT_LIBRARIES}
${MLTPP_LIBRARIES}
)
install(TARGETS westleypreview DESTINATION ${PLUGIN_INSTALL_DIR})
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment