1 # - Try to find VLC library
2 # Once done this will define
4 # VLC_FOUND - system has VLC
5 # VLC_INCLUDE_DIR - The VLC include directory
6 # VLC_LIBRARIES - The libraries needed to use VLC
7 # VLC_DEFINITIONS - Compiler switches required for using VLC
9 # Copyright (C) 2008, Tanguy Krotoff <tkrotoff@gmail.com>
10 # Copyright (C) 2008, Lukas Durfina <lukas.durfina@gmail.com>
11 # Copyright (c) 2009, Fathi Boudra <fboudra@gmail.com>
13 # Redistribution and use is allowed according to the terms of the BSD license.
14 # For details see the accompanying COPYING-CMAKE-SCRIPTS file.
17 if(VLC_INCLUDE_DIR AND VLC_LIBRARIES)
19 set(VLC_FIND_QUIETLY TRUE)
20 endif(VLC_INCLUDE_DIR AND VLC_LIBRARIES)
22 # use pkg-config to get the directories and then use these values
23 # in the FIND_PATH() and FIND_LIBRARY() calls
25 find_package(PkgConfig)
26 pkg_check_modules(VLC libvlc>=1.0.0)
27 set(VLC_DEFINITIONS ${VLC_CFLAGS})
28 set(VLC_LIBRARIES ${VLC_LDFLAGS})
31 # TODO add argument support to pass version on find_package
32 include(MacroEnsureVersion)
33 macro_ensure_version(1.0.0 ${VLC_VERSION} VLC_VERSION_OK)
36 message(STATUS "VLC library found")
39 message(FATAL_ERROR "VLC library not found")
42 find_path(VLC_INCLUDE_DIR
44 PATHS ${VLC_INCLUDE_DIRS}
47 find_library(VLC_LIBRARIES
49 PATHS ${VLC_LIBRARY_DIRS})
51 include(FindPackageHandleStandardArgs)
52 find_package_handle_standard_args(VLC DEFAULT_MSG VLC_INCLUDE_DIR VLC_LIBRARIES)
54 # show the VLC_INCLUDE_DIR and VLC_LIBRARIES variables only in the advanced view
55 mark_as_advanced(VLC_INCLUDE_DIR VLC_LIBRARIES)