Use a separate function to remove a source from fading sources
[alure.git] / cmake / FindFLAC.cmake
blob66cdad6fc4cb7d8f181d2bc9bdbeee7b0db1e643
1 # - FindFLAC.cmake
2 # Find the native FLAC includes and libraries
4 # FLAC_INCLUDE_DIRS - where to find FLAC headers.
5 # FLAC_LIBRARIES - List of libraries when using libFLAC.
6 # FLAC_FOUND - True if libFLAC found.
8 if(FLAC_INCLUDE_DIR)
9     # Already in cache, be silent
10     set(FLAC_FIND_QUIETLY TRUE)
11 endif(FLAC_INCLUDE_DIR)
13 find_path(FLAC_INCLUDE_DIR FLAC/stream_decoder.h)
15 # MSVC built libraries can name them *_static, which is good as it
16 # distinguishes import libraries from static libraries with the same extension.
17 find_library(FLAC_LIBRARY NAMES FLAC libFLAC libFLAC_dynamic libFLAC_static)
19 # Handle the QUIETLY and REQUIRED arguments and set FLAC_FOUND to TRUE if
20 # all listed variables are TRUE.
21 include(FindPackageHandleStandardArgs)
22 find_package_handle_standard_args(FLAC DEFAULT_MSG FLAC_LIBRARY FLAC_INCLUDE_DIR)
24 if(FLAC_FOUND)
25     set(FLAC_LIBRARIES ${FLAC_LIBRARY})
26     if(WIN32)
27         set(FLAC_LIBRARIES ${FLAC_LIBRARIES} wsock32)
28     endif(WIN32)
29     set(FLAC_INCLUDE_DIRS ${FLAC_INCLUDE_DIR})
30 endif(FLAC_FOUND)