FindMLT.cmake 1.31 KB
Newer Older
Vincent Pinon's avatar
Vincent Pinon committed
1 2 3 4 5 6
# Find the MLT includes and libraries
#
# Copyright (c) 2007-2012 Jean-Baptiste Mardell (jb@kdenlive.org)
# Copyright (c) 2012 Alberto Villa <avilla@FreeBSD.org>
#
# Redistribution and use is allowed according to the terms of the BSD license.
7 8

find_package(PkgConfig QUIET)
9
pkg_check_modules(PC_MLT mlt++)
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64

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)