1############################################################################ 2# FindOpus.txt 3# Copyright (C) 2014 Belledonne Communications, Grenoble France 4# 5############################################################################ 6# 7# This program is free software; you can redistribute it and/or 8# modify it under the terms of the GNU General Public License 9# as published by the Free Software Foundation; either version 2 10# of the License, or (at your option) any later version. 11# 12# This program is distributed in the hope that it will be useful, 13# but WITHOUT ANY WARRANTY; without even the implied warranty of 14# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15# GNU General Public License for more details. 16# 17# You should have received a copy of the GNU General Public License 18# along with this program; if not, write to the Free Software 19# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 20# 21############################################################################ 22# 23# - Find the opus include file and library 24# 25# OPUS_FOUND - system has opus 26# OPUS_INCLUDE_DIRS - the opus include directory 27# OPUS_LIBRARIES - The libraries needed to use opus 28 29find_path(OPUS_INCLUDE_DIRS 30 NAMES opus/opus.h 31 PATH_SUFFIXES include 32) 33if(OPUS_INCLUDE_DIRS) 34 set(HAVE_OPUS_OPUS_H 1) 35endif() 36 37find_library(OPUS_LIBRARIES NAMES opus) 38 39if(OPUS_LIBRARIES) 40 find_library(LIBM NAMES m) 41 if(LIBM) 42 list(APPEND OPUS_LIBRARIES ${LIBM}) 43 endif() 44endif() 45 46include(FindPackageHandleStandardArgs) 47find_package_handle_standard_args(Opus 48 DEFAULT_MSG 49 OPUS_INCLUDE_DIRS OPUS_LIBRARIES HAVE_OPUS_OPUS_H 50) 51 52mark_as_advanced(OPUS_INCLUDE_DIRS OPUS_LIBRARIES HAVE_OPUS_OPUS_H) 53