]> git.xonotic.org Git - xonotic/darkplaces.git/blob - buildsys/module/FindVorbis.cmake
cmake: Initial working implementation of cmake build system
[xonotic/darkplaces.git] / buildsys / module / FindVorbis.cmake
1 #
2 # Try to find Ogg/Vorbis libraries and include paths.
3 # Once done this will define
4 #
5 # VORBIS_FOUND
6 # VORBIS_INCLUDE_DIRS
7 # VORBIS_LIBRARIES
8 #
9
10 find_path(OGG_INCLUDE_DIR ogg/ogg.h)
11 find_path(VORBIS_INCLUDE_DIR vorbis/vorbisfile.h)
12
13 find_library(OGG_LIBRARY NAMES ogg)
14 find_library(VORBIS_LIBRARY NAMES vorbis)
15 if (NOT SFML_OS_IOS)
16     find_library(VORBISFILE_LIBRARY NAMES vorbisfile)
17     find_library(VORBISENC_LIBRARY NAMES vorbisenc)
18     set(VORBIS_LIBRARIES ${VORBISENC_LIBRARY} ${VORBISFILE_LIBRARY} ${VORBIS_LIBRARY} ${OGG_LIBRARY})
19 else()
20     set(VORBIS_LIBRARIES ${VORBIS_LIBRARY} ${OGG_LIBRARY})
21 endif()
22
23 include(FindPackageHandleStandardArgs)
24
25 find_package_handle_standard_args(VORBIS DEFAULT_MSG VORBIS_LIBRARIES VORBIS_INCLUDE_DIR OGG_INCLUDE_DIR)
26
27 set(VORBIS_INCLUDE_DIRS ${OGG_INCLUDE_DIR} ${VORBIS_INCLUDE_DIR})
28
29 mark_as_advanced(OGG_INCLUDE_DIR VORBIS_INCLUDE_DIR OGG_LIBRARY VORBIS_LIBRARY VORBISFILE_LIBRARY VORBISENC_LIBRARY)