aboutsummaryrefslogtreecommitdiffstats
path: root/cmake/FindSndFile.cmake
blob: afeec961c9c2e55d885951ceb0d8b103b656993f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# - Try to find SndFile
# Once done this will define
#
#  SNDFILE_FOUND - system has SndFile
#  SNDFILE_INCLUDE_DIRS - the SndFile include directory
#  SNDFILE_LIBRARIES - Link these to use SndFile

find_path(SNDFILE_INCLUDE_DIR NAMES sndfile.h)

find_library(SNDFILE_LIBRARY NAMES sndfile sndfile-1)

# handle the QUIETLY and REQUIRED arguments and set SNDFILE_FOUND to TRUE if
# all listed variables are TRUE
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(SndFile DEFAULT_MSG SNDFILE_LIBRARY SNDFILE_INCLUDE_DIR)

if(SNDFILE_FOUND)
    set(SNDFILE_INCLUDE_DIRS ${SNDFILE_INCLUDE_DIR})
    set(SNDFILE_LIBRARIES ${SNDFILE_LIBRARY})
endif()

# show the SNDFILE_INCLUDE_DIR and SNDFILE_LIBRARY variables only in the advanced view
mark_as_advanced(SNDFILE_INCLUDE_DIR SNDFILE_LIBRARY)