# Find Vlc # # This module defines # Vlc_FOUND # Vlc_INCLUDE_DIRS # Vlc_LIBRARIES # # Copyright (c) 2012 I-maginer # # This program is free software; you can redistribute it and/or modify it under # the terms of the GNU Lesser General Public License as published by the Free Software # Foundation; either version 2 of the License, or (at your option) any later # version. # # This program is distributed in the hope that it will be useful, but WITHOUT # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS # FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public License along with # this program; if not, write to the Free Software Foundation, Inc., 59 Temple # Place - Suite 330, Boston, MA 02111-1307, USA, or go to # http://www.gnu.org/copyleft/lesser.txt # # On a new cmake run, we do not need to be verbose IF(Vlc_INCLUDE_DIR AND Vlc_LIBRARY) SET(Vlc_FIND_QUIETLY TRUE) ENDIF() # If VLC_ROOT was defined in the environment, use it. Else, search in registry for install path. IF(NOT Vlc_ROOT) IF("$ENV{VLC_ROOT}" STREQUAL "") SET(Vlc_ROOT [HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node\\VideoLAN\\VLC;InstallDir] [HKEY_LOCAL_MACHINE\\SOFTWARE\\VideoLAN\\VLC;InstallDir]) ELSE() SET(Vlc_ROOT $ENV{VLC_ROOT}) ENDIF() ENDIF() if(Vlc_ROOT) SET(Vlc_INCLUDE_SEARCH_DIRS ${Vlc_INCLUDE_SEARCH_DIRS} ${Vlc_ROOT}/sdk/include ) SET(Vlc_LIBRARY_SEARCH_DIRS ${Vlc_LIBRARY_SEARCH_DIRS} ${Vlc_ROOT}/sdk/lib ) endif() # log message IF (NOT Vlc_FIND_QUIETLY) MESSAGE(STATUS "Checking for Vlc library") ENDIF() # Search for header files FIND_PATH(Vlc_INCLUDE_DIR vlc/libvlc.h PATHS ${Vlc_INCLUDE_SEARCH_DIRS}) # Search for libraries files FIND_LIBRARY(Vlc_LIBRARY libvlc PATHS ${Vlc_LIBRARY_SEARCH_DIRS}) # Configure libraries SET(Vlc_INCLUDE_DIRS ${Vlc_INCLUDE_DIR} CACHE STRING "Directory containing Vlc header files") SET(Vlc_LIBRARIES ${Vlc_LIBRARY} CACHE STRING "Vlc libraries files") # Hide those variables in GUI SET(Vlc_INCLUDE_DIR ${Vlc_INCLUDE_DIR} CACHE INTERNAL "") SET(Vlc_LIBRARY ${Vlc_LIBRARY} CACHE INTERNAL "") IF(Vlc_INCLUDE_DIR AND Vlc_LIBRARY) SET(Vlc_FOUND TRUE) ENDIF() # log find result IF(Vlc_FOUND) IF(NOT Vlc_FIND_QUIETLY) MESSAGE(STATUS " libraries: ${Vlc_LIBRARIES}") MESSAGE(STATUS " includes: ${Vlc_INCLUDE_DIRS}") ENDIF() ELSE(Vlc_FOUND) IF(NOT Vlc_LIBRARIES) MESSAGE(STATUS, "Vlc library could not be found.") ENDIF() IF(NOT Vlc_INCLUDE_DIRS) MESSAGE(STATUS "Vlc include files could not be found.") ENDIF() ENDIF(Vlc_FOUND)