1# - Try to find SndFile
2# Once done this will define
3#
4#  SNDFILE_FOUND - system has SndFile
5#  SNDFILE_INCLUDE_DIRS - the SndFile include directory
6#  SNDFILE_LIBRARIES - Link these to use SndFile
7#
8#  Copyright © 2006  Wengo
9#  Copyright © 2009 Guillaume Martres
10#
11#  Redistribution and use is allowed according to the terms of the New
12#  BSD license.
13#  For details see the accompanying COPYING-CMAKE-SCRIPTS file.
14#
15
16find_path(SNDFILE_INCLUDE_DIR
17    NAMES
18      sndfile.h
19    PATHS
20      /usr/include
21      /usr/local/include
22      /opt/local/include
23      /sw/include
24)
25
26find_library(SNDFILE_LIBRARY
27    NAMES
28      sndfile sndfile-1
29    PATHS
30      /usr/lib
31      /usr/local/lib
32      /opt/local/lib
33      /sw/lib
34)
35
36set(SNDFILE_INCLUDE_DIRS
37    ${SNDFILE_INCLUDE_DIR}
38)
39set(SNDFILE_LIBRARIES
40    ${SNDFILE_LIBRARY}
41)
42
43INCLUDE(FindPackageHandleStandardArgs)
44# handle the QUIETLY and REQUIRED arguments and set SNDFILE_FOUND to TRUE if
45# all listed variables are TRUE
46FIND_PACKAGE_HANDLE_STANDARD_ARGS(SndFile DEFAULT_MSG SNDFILE_LIBRARY SNDFILE_INCLUDE_DIR)
47
48# show the SNDFILE_INCLUDE_DIRS and SNDFILE_LIBRARIES variables only in the advanced view
49mark_as_advanced(SNDFILE_INCLUDE_DIRS SNDFILE_LIBRARIES)
50