# Find DSound # # This module defines # DSound_FOUND # DSound_INCLUDE_DIRS # DSound_LIBRARIES # # Copyright (c) 2012 I-maginer # # This program is free software; you can redistribute it and/or modify it under # the terms of the GNU Lesser General Public License as published by the Free Software # Foundation; either version 2 of the License, or (at your option) any later # version. # # This program is distributed in the hope that it will be useful, but WITHOUT # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS # FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public License along with # this program; if not, write to the Free Software Foundation, Inc., 59 Temple # Place - Suite 330, Boston, MA 02111-1307, USA, or go to # http://www.gnu.org/copyleft/lesser.txt # if(WIN32) # The only platform it makes sense to check for DSound_ SDK include(FindPkgMacros) findpkg_begin(DSound_) # Windows Phone 8.1 SDK if(WINDOWS_PHONE AND MSVC12) find_path(DSound_INCLUDE_DIR NAMES dsound.h HINTS "C:/Program Files (x86)/Windows Phone Kits/8.1/include" "C:/Program Files/Windows Phone Kits/8.1/include") set(DSound_LIBRARY dsound.lib) # in "C:/Program Files (x86)/Windows Phone Kits/8.1/lib/${MSVC_CXX_ARCHITECTURE_ID}/" # Windows Phone 8.0 SDK elseif(WINDOWS_PHONE AND MSVC11) find_path(DSound_INCLUDE_DIR NAMES dsound.h HINTS "C:/Program Files (x86)/Windows Phone Kits/8.0/include" "C:/Program Files/Windows Phone Kits/8.0/include") set(DSound_LIBRARY dsound.lib) # in "C:/Program Files (x86)/Windows Phone Kits/8.0/lib/${MSVC_CXX_ARCHITECTURE_ID}/" # Windows 8.1 SDK elseif(MSVC12 OR MSVC14) find_path(DSound_INCLUDE_DIR NAMES dsound.h HINTS "C:/Program Files (x86)/Windows Kits/8.1/include/um" "C:/Program Files/Windows Kits/8.1/include/um") set(DSound_LIBRARY dsound.lib) # in "C:/Program Files (x86)/Windows Kits/8.1/lib/winv6.3/um/${MSVC_CXX_ARCHITECTURE_ID}/" # Windows 8.0 SDK elseif(MSVC11) find_path(DSound_INCLUDE_DIR NAMES dsound.h HINTS "C:/Program Files (x86)/Windows Kits/8.0/include/um" "C:/Program Files/Windows Kits/8.0/include/um") set(DSound_LIBRARY dsound.lib) # in "C:/Program Files (x86)/Windows Kits/8.0/lib/win8/um/${MSVC_CXX_ARCHITECTURE_ID}/" # Legacy Direct X SDK else() # Get path, convert backslashes as ${ENV_DXSDK_DIR} getenv_path(DXSDK_DIR) getenv_path(DIRECTX_HOME) getenv_path(DIRECTX_ROOT) getenv_path(DIRECTX_BASE) # construct search paths set(DSound_PREFIX_PATH "${DXSDK_DIR}" "${ENV_DXSDK_DIR}" "${DIRECTX_HOME}" "${ENV_DIRECTX_HOME}" "${DIRECTX_ROOT}" "${ENV_DIRECTX_ROOT}" "${DIRECTX_BASE}" "${ENV_DIRECTX_BASE}" "C:/apps_x86/Microsoft DirectX SDK*" "C:/Program Files (x86)/Microsoft DirectX SDK*" "C:/apps/Microsoft DirectX SDK*" "C:/Program Files/Microsoft DirectX SDK*" "$ENV{ProgramFiles}/Microsoft DirectX SDK*" ) create_search_paths(DSound_) # redo search if prefix path changed clear_if_changed(DSound_PREFIX_PATH DSound_LIBRARY DSound_INCLUDE_DIR ) # dlls are in DSound_ROOT_DIR/Developer Runtime/x64|x86 # lib files are in DSound_ROOT_DIR/Lib/x64|x86 if(CMAKE_CL_64) set(DSound_LIBPATH_SUFFIX "x64") else(CMAKE_CL_64) set(DSound_LIBPATH_SUFFIX "x86") endif(CMAKE_CL_64) # look for dsound components find_path(DSound_INCLUDE_DIR NAMES dsound.h HINTS ${DSound_INC_SEARCH_PATH}) find_library(DSound_LIBRARY NAMES dsound HINTS ${DSound_LIB_SEARCH_PATH} PATH_SUFFIXES ${DSound_LIBPATH_SUFFIX}) if (DSound_INCLUDE_DIR AND DSound_LIBRARY) set(DSound_LIBRARIES ${DSound_LIBRARIES} ${DSound_LIBRARY} ${DSound_DXGI_LIBRARY} ${DSound_DXGUID_LIBRARY} ${DSound_D3DCOMPILER_LIBRARY} ) endif () if (DSound_DXERR_LIBRARY) set(DSound_LIBRARIES ${DSound_LIBRARIES} ${DSound_DXERR_LIBRARY}) endif () set(DSound_LIBRARY ${DSound_LIBRARIES} ) mark_as_advanced(DSound_LIBRARY DSound_DXERR_LIBRARY DSound_DXGUID_LIBRARY DSound_DXGI_LIBRARY DSound_D3DCOMPILER_LIBRARY) endif () # Legacy Direct X SDK findpkg_finish(DSound) endif(WIN32)