# Find Vorbis # # This module defines # Vorbis_FOUND # Vorbis_INCLUDE_DIRS # Vorbis_LIBRARIES # # Copyright (c) 2014 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 # # - Try to find Vorbis # Once done, this will define # # Vorbis_FOUND - system has Vorbis # Vorbis_INCLUDE_DIRS - the Vorbis include directories # Vorbis_LIBRARIES - link these to use Vorbis include(FindPkgMacros) findpkg_begin(Vorbis) # Get path, convert backslashes as ${ENV_${var}} getenv_path(OGG_HOME) # construct search paths set(Vorbis_PREFIX_PATH ${Vorbis_HOME} ${ENV_Vorbis_HOME} ) create_search_paths(Vorbis) # redo search if prefix path changed clear_if_changed(Vorbis_PREFIX_PATH Vorbis_LIBRARY_FWK Vorbis_LIBRARY_REL Vorbis_LIBRARY_DBG Vorbis_INCLUDE_DIR ) set(Vorbis_LIBRARY_NAMES Vorbis Vorbis_d) get_debug_names(Vorbis_LIBRARY_NAMES) use_pkgconfig(Vorbis_PKGC Vorbis-config) findpkg_framework(Vorbis) find_path(Vorbis_INCLUDE_DIR NAMES vorbis/codec.h HINTS ${Vorbis_INC_SEARCH_PATH} ${Vorbis_PKGC_INCLUDE_DIRS}) find_library(Vorbis_LIBRARY_REL NAMES ${Vorbis_LIBRARY_NAMES} HINTS ${Vorbis_LIB_SEARCH_PATH} ${Vorbis_PKGC_LIBRARY_DIRS} PATH_SUFFIXES "" Release RelWithDebInfo MinSizeRel ${ANDROID_ABI}) find_library(Vorbis_LIBRARY_DBG NAMES ${Vorbis_LIBRARY_NAMES_DBG} HINTS ${Vorbis_LIB_SEARCH_PATH} ${Vorbis_PKGC_LIBRARY_DIRS} PATH_SUFFIXES "" Debug ${ANDROID_ABI}) make_library_set(Vorbis_LIBRARY) findpkg_finish(Vorbis)