Use std::domain_error for invalid values instead of out_of_range
[alure.git] / cmake / FindSndFile.cmake
blobab66fc5c2d6e5e090de6bc7491e684c123c8cbbc
1 # - Try to find SndFile
2 # Once done this will define
4 #  SNDFILE_FOUND - system has SndFile
5 #  SNDFILE_INCLUDE_DIRS - the SndFile include directory
6 #  SNDFILE_LIBRARIES - Link these to use SndFile
8 #  Copyright © 2006  Wengo
9 #  Copyright © 2009 Guillaume Martres
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.
16 find_path(SNDFILE_INCLUDE_DIR NAMES sndfile.h)
18 find_library(SNDFILE_LIBRARY NAMES sndfile sndfile-1)
20 set(SNDFILE_INCLUDE_DIRS ${SNDFILE_INCLUDE_DIR})
21 set(SNDFILE_LIBRARIES ${SNDFILE_LIBRARY})
23 INCLUDE(FindPackageHandleStandardArgs)
24 # handle the QUIETLY and REQUIRED arguments and set SNDFILE_FOUND to TRUE if
25 # all listed variables are TRUE
26 FIND_PACKAGE_HANDLE_STANDARD_ARGS(SndFile DEFAULT_MSG SNDFILE_LIBRARY SNDFILE_INCLUDE_DIR)
28 # show the SNDFILE_INCLUDE_DIRS and SNDFILE_LIBRARIES variables only in the advanced view
29 mark_as_advanced(SNDFILE_INCLUDE_DIRS SNDFILE_LIBRARIES)