summaryrefslogtreecommitdiffstats
path: root/cmake/FindSndFile.cmake
diff options
context:
space:
mode:
authorNikolay Korolev <nickvnuk@gmail.com>2020-12-19 01:21:04 +0100
committerNikolay Korolev <nickvnuk@gmail.com>2020-12-19 01:21:04 +0100
commit8d1996833bd73271ca14a3df46633d9b2ed13052 (patch)
treedaedb1622096e5bb6b8b9ec15882769b827506e1 /cmake/FindSndFile.cmake
parentget rid of all PED_SKIN defines (diff)
parentlittle cleanup of templates (diff)
downloadre3-8d1996833bd73271ca14a3df46633d9b2ed13052.tar
re3-8d1996833bd73271ca14a3df46633d9b2ed13052.tar.gz
re3-8d1996833bd73271ca14a3df46633d9b2ed13052.tar.bz2
re3-8d1996833bd73271ca14a3df46633d9b2ed13052.tar.lz
re3-8d1996833bd73271ca14a3df46633d9b2ed13052.tar.xz
re3-8d1996833bd73271ca14a3df46633d9b2ed13052.tar.zst
re3-8d1996833bd73271ca14a3df46633d9b2ed13052.zip
Diffstat (limited to 'cmake/FindSndFile.cmake')
-rw-r--r--cmake/FindSndFile.cmake67
1 files changed, 67 insertions, 0 deletions
diff --git a/cmake/FindSndFile.cmake b/cmake/FindSndFile.cmake
new file mode 100644
index 00000000..8ae47b70
--- /dev/null
+++ b/cmake/FindSndFile.cmake
@@ -0,0 +1,67 @@
+# Found on http://hg.kvats.net
+#
+# - Try to find libsndfile
+#
+# Once done this will define
+#
+# SNDFILE_FOUND - system has libsndfile
+# SNDFILE_INCLUDE_DIRS - the libsndfile include directory
+# SNDFILE_LIBRARIES - Link these to use libsndfile
+#
+# Copyright (C) 2006 Wengo
+#
+# Redistribution and use is allowed according to the terms of the New
+# BSD license.
+# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
+#
+
+if (SNDFILE_LIBRARIES AND SNDFILE_INCLUDE_DIRS)
+ # in cache already
+ set(SNDFILE_FOUND TRUE)
+else (SNDFILE_LIBRARIES AND SNDFILE_INCLUDE_DIRS)
+
+ find_path(SNDFILE_INCLUDE_DIR
+ NAMES
+ sndfile.h
+ PATHS
+ /usr/include
+ /usr/local/include
+ /opt/local/include
+ /sw/include
+ )
+
+ find_library(SNDFILE_LIBRARY
+ NAMES
+ sndfile
+ PATHS
+ /usr/lib
+ /usr/local/lib
+ /opt/local/lib
+ /sw/lib
+ )
+
+ set(SNDFILE_INCLUDE_DIRS
+ ${SNDFILE_INCLUDE_DIR}
+ )
+ set(SNDFILE_LIBRARIES
+ ${SNDFILE_LIBRARY}
+ )
+
+ if (SNDFILE_INCLUDE_DIRS AND SNDFILE_LIBRARIES)
+ set(SNDFILE_FOUND TRUE)
+ endif (SNDFILE_INCLUDE_DIRS AND SNDFILE_LIBRARIES)
+
+ if (SNDFILE_FOUND)
+ if (NOT SndFile_FIND_QUIETLY)
+ message(STATUS "Found libsndfile: ${SNDFILE_LIBRARIES}")
+ endif (NOT SndFile_FIND_QUIETLY)
+ else (SNDFILE_FOUND)
+ if (SndFile_FIND_REQUIRED)
+ message(FATAL_ERROR "Could not find libsndfile")
+ endif (SndFile_FIND_REQUIRED)
+ endif (SNDFILE_FOUND)
+
+ # show the SNDFILE_INCLUDE_DIRS and SNDFILE_LIBRARIES variables only in the advanced view
+ mark_as_advanced(SNDFILE_INCLUDE_DIRS SNDFILE_LIBRARIES)
+
+endif (SNDFILE_LIBRARIES AND SNDFILE_INCLUDE_DIRS)