summaryrefslogtreecommitdiff
path: root/cmake
diff options
context:
space:
mode:
authorPerttu Ahola <celeron55@gmail.com>2012-03-23 12:05:17 +0200
committerPerttu Ahola <celeron55@gmail.com>2012-03-24 04:24:23 +0200
commitc301e3c82af4ad384f4baaa8244b3a5f26da5213 (patch)
treea23bfb49606347f678e81eb7f5fe1eef985d9d02 /cmake
parent9dd78a8a451a7200bfb68b06e034ffb88e32bcd3 (diff)
downloadminetest-c301e3c82af4ad384f4baaa8244b3a5f26da5213.tar.gz
minetest-c301e3c82af4ad384f4baaa8244b3a5f26da5213.tar.bz2
minetest-c301e3c82af4ad384f4baaa8244b3a5f26da5213.zip
celeron55's sound system initial framework
Diffstat (limited to 'cmake')
-rw-r--r--cmake/Modules/FindVorbis.cmake45
1 files changed, 45 insertions, 0 deletions
diff --git a/cmake/Modules/FindVorbis.cmake b/cmake/Modules/FindVorbis.cmake
new file mode 100644
index 000000000..e0cb2c1ac
--- /dev/null
+++ b/cmake/Modules/FindVorbis.cmake
@@ -0,0 +1,45 @@
+# - Find vorbis
+# Find the native vorbis includes and libraries
+#
+# VORBIS_INCLUDE_DIR - where to find vorbis.h, etc.
+# VORBIS_LIBRARIES - List of libraries when using vorbis(file).
+# VORBIS_FOUND - True if vorbis found.
+
+if(NOT GP2XWIZ)
+ if(VORBIS_INCLUDE_DIR)
+ # Already in cache, be silent
+ set(VORBIS_FIND_QUIETLY TRUE)
+ endif(VORBIS_INCLUDE_DIR)
+ find_path(OGG_INCLUDE_DIR ogg/ogg.h)
+ find_path(VORBIS_INCLUDE_DIR vorbis/vorbisfile.h)
+ # MSVC built ogg/vorbis may be named ogg_static and vorbis_static
+ find_library(OGG_LIBRARY NAMES ogg ogg_static)
+ find_library(VORBIS_LIBRARY NAMES vorbis vorbis_static)
+ find_library(VORBISFILE_LIBRARY NAMES vorbisfile vorbisfile_static)
+ # Handle the QUIETLY and REQUIRED arguments and set VORBIS_FOUND
+ # to TRUE if all listed variables are TRUE.
+ include(FindPackageHandleStandardArgs)
+ find_package_handle_standard_args(VORBIS DEFAULT_MSG
+ OGG_INCLUDE_DIR VORBIS_INCLUDE_DIR
+ OGG_LIBRARY VORBIS_LIBRARY VORBISFILE_LIBRARY)
+else(NOT GP2XWIZ)
+ find_path(VORBIS_INCLUDE_DIR tremor/ivorbisfile.h)
+ find_library(VORBIS_LIBRARY NAMES vorbis_dec)
+ find_package_handle_standard_args(VORBIS DEFAULT_MSG
+ VORBIS_INCLUDE_DIR VORBIS_LIBRARY)
+endif(NOT GP2XWIZ)
+
+if(VORBIS_FOUND)
+ if(NOT GP2XWIZ)
+ set(VORBIS_LIBRARIES ${VORBISFILE_LIBRARY} ${VORBIS_LIBRARY}
+ ${OGG_LIBRARY})
+ else(NOT GP2XWIZ)
+ set(VORBIS_LIBRARIES ${VORBIS_LIBRARY})
+ endif(NOT GP2XWIZ)
+else(VORBIS_FOUND)
+ set(VORBIS_LIBRARIES)
+endif(VORBIS_FOUND)
+
+mark_as_advanced(OGG_INCLUDE_DIR VORBIS_INCLUDE_DIR)
+mark_as_advanced(OGG_LIBRARY VORBIS_LIBRARY VORBISFILE_LIBRARY)
+