~ubuntu-branches/ubuntu/wily/udj-desktop-client/wily

« back to all changes in this revision

Viewing changes to cmake/modules/FindLIBVLC.cmake

  • Committer: Package Import Robot
  • Author(s): Nathan Handler
  • Date: 2012-11-14 15:29:07 UTC
  • mfrom: (1.2.1) (4.1.1 experimental)
  • Revision ID: package-import@ubuntu.com-20121114152907-8uj9bwcima77vu28
Tags: 0.6.3-1
* New upstream release
* debian/copyright: Add stanzas for new upstream files
* debian/rules:
  - Do not install ./usr/share/doc/udj/UDJ.1
  - Remove /usr/share/doc/udj directory if it is empty
* debian/control:
  - Bump Standards-Version to 3.9.4 (no changes)
  - Use my @debian.org address for the Maintainer field

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
 
 
2
# CMake module to search for LIBVLC (VLC library)
 
3
# Authors: Rohit Yadav <rohityadav89@gmail.com>
 
4
#          Harald Sitter <apachelogger@ubuntu.com>
 
5
#
 
6
# If it's found it sets LIBVLC_FOUND to TRUE
 
7
# and following variables are set:
 
8
#    LIBVLC_INCLUDE_DIR
 
9
#    LIBVLC_LIBRARY
 
10
#    LIBVLC_VERSION
 
11
 
 
12
if(NOT LIBVLC_MIN_VERSION)
 
13
    set(LIBVLC_MIN_VERSION "0.0")
 
14
endif(NOT LIBVLC_MIN_VERSION)
 
15
 
 
16
# find_path and find_library normally search standard locations
 
17
# before the specified paths. To search non-standard paths first,
 
18
# FIND_* is invoked first with specified paths and NO_DEFAULT_PATH
 
19
# and then again with no specified paths to search the default
 
20
# locations. When an earlier FIND_* succeeds, subsequent FIND_*s
 
21
# searching for the same item do nothing.
 
22
 
 
23
if (NOT WIN32)
 
24
    find_package(PkgConfig)
 
25
    pkg_check_modules(PC_LIBVLC libvlc)
 
26
    set(LIBVLC_DEFINITIONS ${PC_LIBVLC_CFLAGS_OTHER})
 
27
endif (NOT WIN32)
 
28
 
 
29
#Put here path to custom location
 
30
#example: /home/user/vlc/include etc..
 
31
find_path(LIBVLC_INCLUDE_DIR vlc/vlc.h
 
32
HINTS "$ENV{LIBVLC_INCLUDE_PATH}"
 
33
PATHS
 
34
    "$ENV{LIB_DIR}/include"
 
35
    "$ENV{LIB_DIR}/include/vlc"
 
36
    "/usr/include"
 
37
    "/usr/include/vlc"
 
38
    "/usr/local/include"
 
39
    "/usr/local/include/vlc"
 
40
    #mingw
 
41
    c:/msys/local/include
 
42
)
 
43
find_path(LIBVLC_INCLUDE_DIR PATHS "${CMAKE_INCLUDE_PATH}/vlc" NAMES vlc.h 
 
44
        HINTS ${PC_LIBVLC_INCLUDEDIR} ${PC_LIBVLC_INCLUDE_DIRS})
 
45
 
 
46
#Put here path to custom location
 
47
#example: /home/user/vlc/lib etc..
 
48
find_library(LIBVLC_LIBRARY NAMES vlc libvlc
 
49
HINTS "$ENV{LIBVLC_LIBRARY_PATH}" ${PC_LIBVLC_LIBDIR} ${PC_LIBVLC_LIBRARY_DIRS}
 
50
PATHS
 
51
    "$ENV{LIB_DIR}/lib"
 
52
    #mingw
 
53
    c:/msys/local/lib
 
54
)
 
55
find_library(LIBVLC_LIBRARY NAMES vlc libvlc)
 
56
find_library(LIBVLCCORE_LIBRARY NAMES vlccore libvlccore
 
57
HINTS "$ENV{LIBVLC_LIBRARY_PATH}" ${PC_LIBVLC_LIBDIR} ${PC_LIBVLC_LIBRARY_DIRS}
 
58
PATHS
 
59
    "$ENV{LIB_DIR}/lib"
 
60
    #mingw
 
61
    c:/msys/local/lib
 
62
)
 
63
find_library(LIBVLCCORE_LIBRARY NAMES vlccore libvlccore)
 
64
 
 
65
set(LIBVLC_VERSION ${PC_LIBVLC_VERSION})
 
66
if (NOT LIBVLC_VERSION)
 
67
# TODO: implement means to detect version on windows (vlc --version && regex? ... ultimately we would get it from a header though...)
 
68
endif (NOT LIBVLC_VERSION)
 
69
 
 
70
if (LIBVLC_INCLUDE_DIR AND LIBVLC_LIBRARY AND LIBVLCCORE_LIBRARY)
 
71
set(LIBVLC_FOUND TRUE)
 
72
else (LIBVLC_INCLUDE_DIR AND LIBVLC_LIBRARY AND LIBVLCCORE_LIBRARY)
 
73
  message(STATUS "LIBVLC INCLUDE DIR: ${LIBVLC_INCLUDE_DIR}")
 
74
  message(STATUS "LIBVLC LIBRARY : ${LIBVLC_LIBRARY}")
 
75
  message(STATUS "LIBVLC CORE LIBRARY : ${LIBVLCCORE_LIBRARY}")
 
76
endif (LIBVLC_INCLUDE_DIR AND LIBVLC_LIBRARY AND LIBVLCCORE_LIBRARY)
 
77
 
 
78
if (LIBVLC_VERSION STRLESS "${LIBVLC_MIN_VERSION}")
 
79
    message(WARNING "LibVLC version not found: version searched: ${LIBVLC_MIN_VERSION}, found ${LIBVLC_VERSION}\nUnless you are on Windows this is bound to fail.")
 
80
# TODO: only activate once version detection can be garunteed (which is currently not the case on windows)
 
81
#     set(LIBVLC_FOUND FALSE)
 
82
endif (LIBVLC_VERSION STRLESS "${LIBVLC_MIN_VERSION}")
 
83
 
 
84
if (LIBVLC_FOUND)
 
85
    if (NOT LIBVLC_FIND_QUIETLY)
 
86
        message(STATUS "Found LibVLC include-dir path: ${LIBVLC_INCLUDE_DIR}")
 
87
        message(STATUS "Found LibVLC library path:${LIBVLC_LIBRARY}")
 
88
        message(STATUS "Found LibVLCcore library path:${LIBVLCCORE_LIBRARY}")
 
89
        message(STATUS "Found LibVLC version: ${LIBVLC_VERSION} (searched for: ${LIBVLC_MIN_VERSION})")
 
90
    endif (NOT LIBVLC_FIND_QUIETLY)
 
91
else (LIBVLC_FOUND)
 
92
    if (LIBVLC_FIND_REQUIRED)
 
93
        message(FATAL_ERROR "Could not find LibVLC")
 
94
    endif (LIBVLC_FIND_REQUIRED)
 
95
endif (LIBVLC_FOUND)
 
96