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.
9 #if(NOT SNDFILE_FIND_QUIETLY)
10 # message(STATUS "FindSndfile: sndfile deactivated (NO_LIBSNDFILE)")
12 set(SNDFILE_FOUND False)
13 set(SNDFILE_INCLUDE_DIR "nowhere") # for onceonly check above
14 set(SNDFILE_LIBRARIES "")
15 add_definitions("-DNO_LIBSNDFILE")
16 elseif (SNDFILE_INCLUDE_DIR AND SNDFILE_LIBRARY)
17 set(SNDFILE_LIBRARIES ${SNDFILE_LIBRARY})
18 set(SNDFILE_FOUND TRUE)
20 set(SNDFILE_FOUND TRUE)
21 set(SNDFILE_INCLUDE_DIR ${CMAKE_CURRENT_LIST_DIR}/../external_libraries/libsndfile/)
22 set(SNDFILE_LIBRARIES ${CMAKE_CURRENT_LIST_DIR}/../platform/mac/lib/scUBlibsndfile.a)
23 add_definitions("-isystem ${CMAKE_CURRENT_LIST_DIR}/../external_libraries/libsndfile")
25 # TODO on non-apple platforms, we need to be able to test for >=1018.
26 # (On apple it is known true, because we bundle a later version.)
27 add_definitions("-DLIBSNDFILE_1018")
30 find_path(SNDFILE_INCLUDE_DIR sndfile.h)
32 find_library(SNDFILE_LIBRARY NAMES sndfile)
34 # Handle the QUIETLY and REQUIRED arguments and set SNDFILE_FOUND to TRUE if
35 # all listed variables are TRUE.
36 include(FindPackageHandleStandardArgs)
37 find_package_handle_standard_args(Sndfile DEFAULT_MSG
38 SNDFILE_LIBRARY SNDFILE_INCLUDE_DIR)
41 set(SNDFILE_LIBRARIES ${SNDFILE_LIBRARY})
43 set(SNDFILE_LIBRARIES)
47 mark_as_advanced(SNDFILE_INCLUDE_DIR SNDFILE_LIBRARY)