1#
2# Try to find libsndfile
3# Once done this will define
4#
5#  SNDFILE_FOUND - libsndfile was found
6#  SNDFILE_INCLUDE_DIR - the libsndfile include directory
7#  SNDFILE_LIBRARIES - libsndfile libraries to link to
8#
9# SPDX-FileCopyrightText: 2008 Sebastian Trueg <trueg@kde.org>
10# SPDX-License-Identifier: BSD-3-Clause
11
12if ( SNDFILE_INCLUDE_DIR AND SNDFILE_LIBRARIES )
13   # in cache already
14   SET(Sndfile_FIND_QUIETLY TRUE)
15endif ( SNDFILE_INCLUDE_DIR AND SNDFILE_LIBRARIES )
16
17IF (NOT WIN32)
18  # use pkg-config to get the directories and then use these values
19  # in the FIND_PATH() and FIND_LIBRARY() calls
20  include(FindPkgConfig)
21
22  pkg_check_modules(_pc_SNDFILE sndfile)
23ENDIF (NOT WIN32)
24
25
26FIND_PATH(SNDFILE_INCLUDE_DIR
27  NAMES sndfile.h
28  HINTS ${_pc_SNDFILE_INCLUDE_DIRS}
29)
30
31FIND_LIBRARY(SNDFILE_LIBRARIES
32  NAMES sndfile
33  HINTS ${_pc_SNDFILE_LIBRARY_DIRS}
34)
35
36include(FindPackageHandleStandardArgs)
37FIND_PACKAGE_HANDLE_STANDARD_ARGS(Sndfile DEFAULT_MSG SNDFILE_INCLUDE_DIR SNDFILE_LIBRARIES )
38
39# show the SNDFILE_INCLUDE_DIR and SNDFILE_LIBRARIES variables only in the advanced view
40MARK_AS_ADVANCED(SNDFILE_INCLUDE_DIR SNDFILE_LIBRARIES )
41
42