1
# - Try to find the XINE library
2
# Once done this will define
4
# XINE_FOUND - system has the XINE library
5
# XINE_VERSION - XINE version
6
# XINE_BUGFIX_VERSION - the XINE bugfix version
7
# XINE_INCLUDE_DIR - the XINE include directory
8
# XINE_LIBRARY - The libraries needed to use XINE
9
# XINE_XCB_FOUND - libxine can use XCB for video output
11
# Copyright (c) 2006,2007 Laurent Montel, <montel@kde.org>
12
# Copyright (c) 2006, Matthias Kretz, <kretz@kde.org>
14
# Redistribution and use is allowed according to the terms of the BSD license.
15
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
17
if (XINE_INCLUDE_DIR AND XINE_LIBRARY)
18
# Already in cache, be silent
19
set(Xine_FIND_QUIETLY TRUE)
20
endif (XINE_INCLUDE_DIR AND XINE_LIBRARY)
22
find_package(PkgConfig)
24
pkg_check_modules(PC_LIBXINE libxine)
25
endif (PKG_CONFIG_FOUND)
27
find_path(XINE_INCLUDE_DIR NAMES xine.h
28
HINTS # HINTS is new in cmake 2.6. These dirs will be preferred over the default ones
29
${PC_LIBXINE_INCLUDEDIR}
30
${PC_LIBXINE_INCLUDE_DIRS}
33
find_library(XINE_LIBRARY NAMES xine
36
${PC_LIBXINE_LIBRARY_DIRS}
39
find_program(XINECONFIG_EXECUTABLE NAMES xine-config
41
${PC_LIBXINE_PREFIX}/bin
44
if (XINE_INCLUDE_DIR AND XINE_LIBRARY AND XINECONFIG_EXECUTABLE)
45
exec_program(${XINECONFIG_EXECUTABLE} ARGS --version RETURN_VALUE _return_VALUE OUTPUT_VARIABLE XINE_VERSION)
46
if("${XINE_VERSION}" VERSION_GREATER "1.1.0") #if (... VERSION_GREATER) is new since cmake 2.6.2
47
set(XINE_VERSION_OK TRUE)
48
string(REGEX REPLACE "[0-9]\\.[0-9]\\." "" XINE_BUGFIX_VERSION ${XINE_VERSION})
49
endif("${XINE_VERSION}" VERSION_GREATER "1.1.0")
50
endif (XINE_INCLUDE_DIR AND XINE_LIBRARY AND XINECONFIG_EXECUTABLE)
54
include(CheckCSourceCompiles)
55
set(CMAKE_REQUIRED_INCLUDES ${XINE_INCLUDE_DIR})
56
set(CMAKE_REQUIRED_LIBRARIES ${XINE_LIBRARY})
57
check_c_source_compiles("#include <xine.h>\nint main()\n{\n xine_open_video_driver(xine_new(), \"auto\", XINE_VISUAL_TYPE_XCB, NULL);\n return 0;\n}\n" XINE_XCB_FOUND)
59
endif(XINE_VERSION_OK)
61
include(FindPackageHandleStandardArgs)
62
find_package_handle_standard_args(Xine "Could NOT find XINE 1.1.1 or greater" XINE_INCLUDE_DIR XINE_LIBRARY XINECONFIG_EXECUTABLE XINE_VERSION_OK)
64
mark_as_advanced(XINE_INCLUDE_DIR XINE_LIBRARY XINECONFIG_EXECUTABLE)