Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F16569858
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
4 KB
Referenced Files
None
Subscribers
None
View Options
diff --git a/cmake/modules/FindXine.cmake b/cmake/modules/FindXine.cmake
index 37c58c6cd6..0319b7d568 100644
--- a/cmake/modules/FindXine.cmake
+++ b/cmake/modules/FindXine.cmake
@@ -1,64 +1,71 @@
# - Try to find the XINE library
# Once done this will define
#
# XINE_FOUND - system has the XINE library
# XINE_VERSION - XINE version
# XINE_BUGFIX_VERSION - the XINE bugfix version
# XINE_INCLUDE_DIR - the XINE include directory
# XINE_LIBRARY - The libraries needed to use XINE
# XINE_XCB_FOUND - libxine can use XCB for video output
# Copyright (c) 2006,2007 Laurent Montel, <montel@kde.org>
# Copyright (c) 2006, Matthias Kretz, <kretz@kde.org>
#
# Redistribution and use is allowed according to the terms of the BSD license.
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
-if (XINE_INCLUDE_DIR AND XINE_LIBRARY)
- # Already in cache, be silent
- set(Xine_FIND_QUIETLY TRUE)
-endif (XINE_INCLUDE_DIR AND XINE_LIBRARY)
+# Support XINE_MIN_VERSION for compatibility:
+IF(NOT Xine_FIND_VERSION)
+ SET(Xine_FIND_VERSION "${XINE_MIN_VERSION}")
+ENDIF(NOT Xine_FIND_VERSION)
-find_package(PkgConfig)
-if (PKG_CONFIG_FOUND)
- pkg_check_modules(PC_LIBXINE QUIET libxine)
-endif (PKG_CONFIG_FOUND)
+# the minimum version of xine we require
+IF(NOT Xine_FIND_VERSION)
+ SET(Xine_FIND_VERSION "1.1.0")
+ENDIF(NOT Xine_FIND_VERSION)
-find_path(XINE_INCLUDE_DIR NAMES xine.h
- HINTS # HINTS is new in cmake 2.6. These dirs will be preferred over the default ones
- ${PC_LIBXINE_INCLUDEDIR}
- ${PC_LIBXINE_INCLUDE_DIRS}
- )
+FIND_PACKAGE(PkgConfig)
+PKG_CHECK_MODULES(PC_LIBXINE QUIET libxine)
+SET(XINE_DEFINITIONS ${PC_XINE_CFLAGS_OTHER})
-find_library(XINE_LIBRARY NAMES xine
- HINTS
+FIND_PATH(XINE_INCLUDE_DIR NAMES xine.h
+ HINTS
+ ${PC_LIBXINE_INCLUDEDIR}
+ ${PC_LIBXINE_INCLUDE_DIRS}
+)
+
+FIND_LIBRARY(XINE_LIBRARY NAMES xine
+ HINTS
${PC_LIBXINE_LIBDIR}
${PC_LIBXINE_LIBRARY_DIRS}
- )
+)
-find_program(XINECONFIG_EXECUTABLE NAMES xine-config
- HINTS
- ${PC_LIBXINE_PREFIX}/bin
+FIND_PROGRAM(XINECONFIG_EXECUTABLE NAMES xine-config
+ HINTS
+ ${PC_LIBXINE_PREFIX}/bin
)
-if (XINE_INCLUDE_DIR AND XINE_LIBRARY AND XINECONFIG_EXECUTABLE)
- exec_program(${XINECONFIG_EXECUTABLE} ARGS --version RETURN_VALUE _return_VALUE OUTPUT_VARIABLE XINE_VERSION ERROR_QUIET)
- if("${XINE_VERSION}" VERSION_GREATER "1.1.0") #if (... VERSION_GREATER) is new since cmake 2.6.2
- set(XINE_VERSION_OK TRUE)
- string(REGEX REPLACE "[0-9]\\.[0-9]\\." "" XINE_BUGFIX_VERSION ${XINE_VERSION})
- endif("${XINE_VERSION}" VERSION_GREATER "1.1.0")
-endif (XINE_INCLUDE_DIR AND XINE_LIBRARY AND XINECONFIG_EXECUTABLE)
+# Get the version number from xine.h and store it in the cache:
+IF(XINE_INCLUDE_DIR AND NOT XINE_VERSION)
+ FILE(READ ${XINE_INCLUDE_DIR}/xine.h XINE_VERSION_CONTENT)
+ STRING(REGEX MATCH "#define *XINE_MAJOR_VERSION *([0-9]+)" _dummy "${XINE_VERSION_CONTENT}")
+ SET(XINE_VERSION_MAJOR "${CMAKE_MATCH_1}")
+
+ STRING(REGEX MATCH "#define *XINE_MINOR_VERSION *([0-9]+)" _dummy "${XINE_VERSION_CONTENT}")
+ SET(XINE_VERSION_MINOR "${CMAKE_MATCH_1}")
+
+ STRING(REGEX MATCH "#define *XINE_SUB_VERSION *([0-9]+)" _dummy "${XINE_VERSION_CONTENT}")
+ SET(XINE_VERSION_PATCH "${CMAKE_MATCH_1}")
+ SET(XINE_VERSION "${XINE_VERSION_MAJOR}.${XINE_VERSION_MINOR}.${XINE_VERSION_PATCH}" CACHE STRING "Version number of Xine" FORCE)
-if( XINE_VERSION_OK)
- include(CheckCSourceCompiles)
- set(CMAKE_REQUIRED_INCLUDES ${XINE_INCLUDE_DIR})
- set(CMAKE_REQUIRED_LIBRARIES ${XINE_LIBRARY})
- 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)
- set(XINE_FOUND TRUE)
-endif(XINE_VERSION_OK)
+ IF("${XINE_VERSION}" VERSION_GREATER "${Xine_FIND_VERSION}")
+ STRING(REGEX REPLACE "[0-9]\\.[0-9]\\." "" XINE_BUGFIX_VERSION ${XINE_VERSION})
+ ENDIF("${XINE_VERSION}" VERSION_GREATER "${Xine_FIND_VERSION}")
+ENDIF(XINE_INCLUDE_DIR AND NOT XINE_VERSION)
-include(FindPackageHandleStandardArgs)
-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)
+INCLUDE(FindPackageHandleStandardArgs)
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(Xine REQUIRED_VARS XINE_INCLUDE_DIR XINE_LIBRARY XINECONFIG_EXECUTABLE
+ VERSION_VAR XINE_VERSION)
-mark_as_advanced(XINE_INCLUDE_DIR XINE_LIBRARY XINECONFIG_EXECUTABLE)
+MARK_AS_ADVANCED(XINE_INCLUDE_DIR XINE_LIBRARY XINECONFIG_EXECUTABLE)
File Metadata
Details
Attached
Mime Type
text/x-diff
Expires
Fri, Nov 1, 8:50 AM (1 d, 10 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
10075305
Default Alt Text
(4 KB)
Attached To
Mode
rKL kdelibs
Attached
Detach File
Event Timeline
Log In to Comment