1 # - Try to find SndFile
2 # Once done this will define
4 # SNDFILE_FOUND - system has SndFile
5 # SndFile::SndFile - the SndFile target
8 find_path(SNDFILE_INCLUDE_DIR NAMES sndfile.h)
10 find_library(SNDFILE_LIBRARY NAMES sndfile sndfile-1)
12 # handle the QUIETLY and REQUIRED arguments and set SNDFILE_FOUND to TRUE if
13 # all listed variables are TRUE
14 include(FindPackageHandleStandardArgs)
15 find_package_handle_standard_args(SndFile DEFAULT_MSG SNDFILE_LIBRARY SNDFILE_INCLUDE_DIR)
18 add_library(SndFile::SndFile UNKNOWN IMPORTED)
19 set_target_properties(SndFile::SndFile PROPERTIES
20 IMPORTED_LOCATION ${SNDFILE_LIBRARY}
21 INTERFACE_INCLUDE_DIRECTORIES ${SNDFILE_INCLUDE_DIR})
24 # show the SNDFILE_INCLUDE_DIR and SNDFILE_LIBRARY variables only in the advanced view
25 mark_as_advanced(SNDFILE_INCLUDE_DIR SNDFILE_LIBRARY)