Веб-сайт самохостера Lotigara

summaryrefslogtreecommitdiff
path: root/cmake/FindOggVorbis.cmake
diff options
context:
space:
mode:
authorKae <80987908+Novaenia@users.noreply.github.com>2023-06-20 14:33:09 +1000
committerKae <80987908+Novaenia@users.noreply.github.com>2023-06-20 14:33:09 +1000
commit6352e8e3196f78388b6c771073f9e03eaa612673 (patch)
treee23772f79a7fbc41bc9108951e9e136857484bf4 /cmake/FindOggVorbis.cmake
parent6741a057e5639280d85d0f88ba26f000baa58f61 (diff)
everything everywhere
all at once
Diffstat (limited to 'cmake/FindOggVorbis.cmake')
-rw-r--r--cmake/FindOggVorbis.cmake57
1 files changed, 57 insertions, 0 deletions
diff --git a/cmake/FindOggVorbis.cmake b/cmake/FindOggVorbis.cmake
new file mode 100644
index 0000000..4f984db
--- /dev/null
+++ b/cmake/FindOggVorbis.cmake
@@ -0,0 +1,57 @@
+# - Try to find the OggVorbis libraries
+# Once done this will define
+#
+# OGGVORBIS_FOUND - system has OggVorbis
+# OGGVORBIS_VERSION - set either to 1 or 2
+# OGGVORBIS_INCLUDE_DIR - the OggVorbis include directory
+# OGGVORBIS_LIBRARIES - The libraries needed to use OggVorbis
+# OGG_LIBRARY - The Ogg library
+# VORBIS_LIBRARY - The Vorbis library
+# VORBISFILE_LIBRARY - The VorbisFile library
+
+# Copyright (c) 2006, Richard Laerkaeng, <richard@goteborg.utfors.se>
+#
+# Redistribution and use is allowed according to the terms of the BSD license.
+# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
+
+
+include (CheckLibraryExists)
+
+find_path(VORBIS_INCLUDE_DIR vorbis/vorbisfile.h)
+find_path(OGG_INCLUDE_DIR ogg/ogg.h)
+
+find_library(OGG_LIBRARY NAMES ogg)
+find_library(VORBIS_LIBRARY NAMES vorbis)
+find_library(VORBISFILE_LIBRARY NAMES vorbisfile)
+
+mark_as_advanced(VORBIS_INCLUDE_DIR OGG_INCLUDE_DIR
+ OGG_LIBRARY VORBIS_LIBRARY VORBISFILE_LIBRARY)
+
+
+if (VORBIS_INCLUDE_DIR AND VORBIS_LIBRARY AND VORBISFILE_LIBRARY)
+ set(OGGVORBIS_FOUND TRUE)
+
+ set(OGGVORBIS_LIBRARIES ${OGG_LIBRARY} ${VORBIS_LIBRARY} ${VORBISFILE_LIBRARY})
+
+ set(_CMAKE_REQUIRED_LIBRARIES_TMP ${CMAKE_REQUIRED_LIBRARIES})
+ set(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} ${OGGVORBIS_LIBRARIES})
+ set(CMAKE_REQUIRED_LIBRARIES ${_CMAKE_REQUIRED_LIBRARIES_TMP})
+
+else (VORBIS_INCLUDE_DIR AND VORBIS_LIBRARY AND VORBISFILE_LIBRARY)
+ set (OGGVORBIS_VERSION)
+ set(OGGVORBIS_FOUND FALSE)
+endif (VORBIS_INCLUDE_DIR AND VORBIS_LIBRARY AND VORBISFILE_LIBRARY)
+
+
+if (OGGVORBIS_FOUND)
+ if (NOT OggVorbis_FIND_QUIETLY)
+ message(STATUS "Found OggVorbis: ${OGGVORBIS_LIBRARIES}")
+ endif (NOT OggVorbis_FIND_QUIETLY)
+else (OGGVORBIS_FOUND)
+ if (OggVorbis_FIND_REQUIRED)
+ message(FATAL_ERROR "Could NOT find OggVorbis libraries")
+ endif (OggVorbis_FIND_REQUIRED)
+ if (NOT OggVorbis_FIND_QUITELY)
+ message(STATUS "Could NOT find OggVorbis libraries")
+ endif (NOT OggVorbis_FIND_QUITELY)
+endif (OGGVORBIS_FOUND)