Print the opened device in alffplay
[openal-soft.git] / cmake / FindDSound.cmake
blob4078deb5ed7ed8cbecac8a3acd127d157c7a9c8d
1 # - Find DirectSound includes and libraries
3 #   DSOUND_FOUND        - True if DSOUND_INCLUDE_DIR & DSOUND_LIBRARY are found
4 #   DSOUND_LIBRARIES    - Set when DSOUND_LIBRARY is found
5 #   DSOUND_INCLUDE_DIRS - Set when DSOUND_INCLUDE_DIR is found
7 #   DSOUND_INCLUDE_DIR - where to find dsound.h, etc.
8 #   DSOUND_LIBRARY     - the dsound library
11 if (WIN32)
12   include(FindWindowsSDK)
13   if (WINDOWSSDK_FOUND)
14     get_windowssdk_library_dirs(${WINDOWSSDK_PREFERRED_DIR} WINSDK_LIB_DIRS)
15     get_windowssdk_include_dirs(${WINDOWSSDK_PREFERRED_DIR} WINSDK_INCLUDE_DIRS)
16   endif()
17 endif()
19 # DSOUND_INCLUDE_DIR
20 find_path(DSOUND_INCLUDE_DIR
21           NAMES "dsound.h" 
22           PATHS "${DXSDK_DIR}" ${WINSDK_INCLUDE_DIRS} 
23           PATH_SUFFIXES include
24           DOC "The DirectSound include directory")
26 # DSOUND_LIBRARY
27 find_library(DSOUND_LIBRARY
28              NAMES dsound
29              PATHS "${DXSDK_DIR}" ${WINSDK_LIB_DIRS}
30              PATH_SUFFIXES lib lib/x86 lib/x64
31              DOC "The DirectSound library")
33 include(FindPackageHandleStandardArgs)
34 find_package_handle_standard_args(DSound REQUIRED_VARS DSOUND_LIBRARY DSOUND_INCLUDE_DIR)
36 if(DSOUND_FOUND)
37     set(DSOUND_LIBRARIES ${DSOUND_LIBRARY})
38     set(DSOUND_INCLUDE_DIRS ${DSOUND_INCLUDE_DIR})
39 endif()
41 mark_as_advanced(DSOUND_INCLUDE_DIR DSOUND_LIBRARY)