1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-08-22 21:54:00 +02:00

Further simplify FindVLC

This commit is contained in:
Uwe L. Korn
2014-10-22 10:45:02 +02:00
parent 3a8d23c5b1
commit dc50191f34
3 changed files with 5 additions and 46 deletions

View File

@@ -346,7 +346,7 @@ endif()
macro_log_feature(LIBSNORE_FOUND "Libsnore" "Library for notifications" "https://github.com/TheOneRing/Snorenotify" FALSE "" "") macro_log_feature(LIBSNORE_FOUND "Libsnore" "Library for notifications" "https://github.com/TheOneRing/Snorenotify" FALSE "" "")
endif() endif()
find_package(LIBVLC REQUIRED) find_package(LIBVLC REQUIRED 2.1.0)
macro_log_feature(LIBVLC_FOUND "LibVLC" "Provides audio output" TRUE "" "") macro_log_feature(LIBVLC_FOUND "LibVLC" "Provides audio output" TRUE "" "")
set(QXTWEB_FOUND TRUE) set(QXTWEB_FOUND TRUE)

View File

@@ -1,17 +1,3 @@
# CMake module to search for LIBVLC (VLC library)
# Authors: Rohit Yadav <rohityadav89@gmail.com>
# Harald Sitter <apachelogger@ubuntu.com>
#
# If it's found it sets LIBVLC_FOUND to TRUE
# and following variables are set:
# LIBVLC_INCLUDE_DIR
# LIBVLC_LIBRARY
# LIBVLC_VERSION
if(NOT LIBVLC_MIN_VERSION)
set(LIBVLC_MIN_VERSION "2.1")
endif(NOT LIBVLC_MIN_VERSION)
find_package(PkgConfig QUIET) find_package(PkgConfig QUIET)
pkg_check_modules(PC_LIBVLC QUIET libvlc) pkg_check_modules(PC_LIBVLC QUIET libvlc)
set(LIBVLC_DEFINITIONS ${PC_LIBVLC_CFLAGS_OTHER}) set(LIBVLC_DEFINITIONS ${PC_LIBVLC_CFLAGS_OTHER})
@@ -22,12 +8,6 @@ find_path(LIBVLC_INCLUDE_DIR vlc/vlc.h
${PC_LIBVLC_INCLUDE_DIRS} ${PC_LIBVLC_INCLUDE_DIRS}
) )
find_path(LIBVLCCORE_INCLUDE_DIR vlc_plugin.h
HINTS
${PC_LIBVLC_INCLUDEDIR}
${PC_LIBVLC_INCLUDE_DIRS}
)
find_library(LIBVLC_LIBRARY NAMES vlc libvlc find_library(LIBVLC_LIBRARY NAMES vlc libvlc
HINTS HINTS
${PC_LIBVLC_LIBDIR} ${PC_LIBVLC_LIBDIR}
@@ -41,30 +21,10 @@ find_library(LIBVLCCORE_LIBRARY NAMES vlccore libvlccore
) )
set(LIBVLC_VERSION ${PC_LIBVLC_VERSION}) set(LIBVLC_VERSION ${PC_LIBVLC_VERSION})
if (NOT LIBVLC_VERSION)
# TODO: implement means to detect version on windows (vlc --version && regex? ... ultimately we would get it from a header though...)
endif (NOT LIBVLC_VERSION)
find_package_handle_standard_args(LibVLC DEFAULT_MSG LIBVLC_LIBRARY LIBVLCCORE_LIBRARY LIBVLC_INCLUDE_DIR) find_package_handle_standard_args(LibVLC
REQUIRED_VARS LIBVLC_LIBRARY LIBVLCCORE_LIBRARY LIBVLC_INCLUDE_DIR
if (LIBVLC_VERSION STRLESS "${LIBVLC_MIN_VERSION}") VERSION_VAR LIBVLC_VERSION
message(WARNING "LibVLC version not found: version searched: ${LIBVLC_MIN_VERSION}, found ${LIBVLC_VERSION}\nUnless you are on Windows this is bound to fail.") )
# TODO: only activate once version detection can be garunteed (which is currently not the case on windows)
# set(LIBVLC_FOUND FALSE)
endif (LIBVLC_VERSION STRLESS "${LIBVLC_MIN_VERSION}")
if (LIBVLC_FOUND)
if (NOT LIBVLC_FIND_QUIETLY)
message(STATUS "Found LibVLC include-dir path: ${LIBVLC_INCLUDE_DIR}")
message(STATUS "Found LibVLC library: ${LIBVLC_LIBRARY}")
message(STATUS "Found LibVLCcore library: ${LIBVLCCORE_LIBRARY}")
message(STATUS "Found LibVLC version: ${LIBVLC_VERSION} (searched for: ${LIBVLC_MIN_VERSION})")
endif (NOT LIBVLC_FIND_QUIETLY)
else (LIBVLC_FOUND)
if (LIBVLC_FIND_REQUIRED)
message(FATAL_ERROR "Could not find LibVLC")
endif (LIBVLC_FIND_REQUIRED)
endif (LIBVLC_FOUND)

View File

@@ -392,7 +392,6 @@ include_directories(
${ECHONEST_INCLUDE_DIR} ${ECHONEST_INCLUDE_DIR}
${LUCENEPP_INCLUDE_DIRS} ${LUCENEPP_INCLUDE_DIRS}
${LIBVLC_INCLUDE_DIR} ${LIBVLC_INCLUDE_DIR}
${LIBVLCCORE_INCLUDE_DIR}
${Boost_INCLUDE_DIR} ${Boost_INCLUDE_DIR}
${LIBPORTFWD_INCLUDE_DIR} ${LIBPORTFWD_INCLUDE_DIR}