2 # Find the native sndfile includes and libraries
4 # SNDFILE_INCLUDE_DIR - where to find sndfile.h, etc.
5 # SNDFILE_LIBRARIES - List of libraries when using libsndfile.
6 # SNDFILE_FOUND - True if libsndfile found.
8 if(SNDFILE_INCLUDE_DIR)
9 # Already in cache, be silent
10 set(SNDFILE_FIND_QUIETLY TRUE)
11 endif(SNDFILE_INCLUDE_DIR)
14 #if(NOT SNDFILE_FIND_QUIETLY)
15 # message(STATUS "FindSndfile: sndfile deactivated (NO_LIBSNDFILE)")
17 set(SNDFILE_FOUND False)
18 set(SNDFILE_INCLUDE_DIR "nowhere") # for onceonly check above
19 set(SNDFILE_LIBRARIES "")
20 add_definitions("-DNO_LIBSNDFILE")
22 set(SNDFILE_FOUND TRUE)
23 set(SNDFILE_INCLUDE_DIR ${CMAKE_SOURCE_DIR}/external_libraries/libsndfile/)
24 set(SNDFILE_LIBRARIES ${CMAKE_SOURCE_DIR}/platform/mac/lib/scUBlibsndfile.a)
25 add_definitions("-isystem ${CMAKE_SOURCE_DIR}/external_libraries/libsndfile")
27 # TODO on non-apple platforms, we need to be able to test for >=1018.
28 # (On apple it is known true, because we bundle a later version.)
29 add_definitions("-DLIBSNDFILE_1018")
32 find_path(SNDFILE_INCLUDE_DIR sndfile.h)
34 find_library(SNDFILE_LIBRARY NAMES sndfile)
36 # Handle the QUIETLY and REQUIRED arguments and set SNDFILE_FOUND to TRUE if
37 # all listed variables are TRUE.
38 include(FindPackageHandleStandardArgs)
39 find_package_handle_standard_args(SNDFILE DEFAULT_MSG
40 SNDFILE_INCLUDE_DIR SNDFILE_LIBRARY)
43 set(SNDFILE_LIBRARIES ${SNDFILE_LIBRARY})
45 set(SNDFILE_LIBRARIES)
49 mark_as_advanced(SNDFILE_INCLUDE_DIR SNDFILE_LIBRARY)