aboutsummaryrefslogtreecommitdiffstats
path: root/cmake/FindDSound.cmake
diff options
context:
space:
mode:
authorseptag <[email protected]>2016-11-03 00:37:09 +0330
committerseptag <[email protected]>2016-11-03 00:37:09 +0330
commitd142ba1ab4d5d63f166f9236da21460ec90ce9bd (patch)
tree7111011aed3a5431bd8c3b24fcbe342a7b57796d /cmake/FindDSound.cmake
parentd01d30ad5e4fb430b0d36fb3eaa3b7f13aa8f65d (diff)
Added cmake FindWindowsSDK for FindDSound module and fixed FindDSound.cmake
Diffstat (limited to 'cmake/FindDSound.cmake')
-rw-r--r--cmake/FindDSound.cmake66
1 files changed, 13 insertions, 53 deletions
diff --git a/cmake/FindDSound.cmake b/cmake/FindDSound.cmake
index 3fd26ed6..70e94269 100644
--- a/cmake/FindDSound.cmake
+++ b/cmake/FindDSound.cmake
@@ -8,68 +8,28 @@
# DSOUND_LIBRARY - the dsound library
#
-# DSOUND_INCLUDE_DIR
-file(GLOB DXSDK_INCLUDE_DIRS LIST_DIRECTORIES TRUE "C:/Program Files (x86)/Windows Kits/10/Include/*")
-if (DXSDK_INCLUDE_DIRS)
- list(SORT DXSDK_INCLUDE_DIRS)
- list(REVERSE DXSDK_INCLUDE_DIRS)
-endif()
+if (WIN32)
+ include(FindWindowsSDK)
+ get_windowssdk_library_dirs(${WINDOWSSDK_PREFERRED_DIR} WINSDK_LIB_DIRS)
+ get_windowssdk_include_dirs(${WINDOWSSDK_PREFERRED_DIR} WINSDK_INCLUDE_DIRS)
+endif()
+# DSOUND_INCLUDE_DIR
find_path(DSOUND_INCLUDE_DIR
- NAMES
- "dsound.h"
- PATHS
- "${DXSDK_DIR}"
- ${DXSDK_INCLUDE_DIRS}
- "C:/Program Files (x86)/Windows Kits/8.0"
- "C:/Program Files (x86)/Windows Kits/8.1"
- PATH_SUFFIXES
- Include
- um
- Include/um
- DOC
- "The DirectSound include directory"
-)
+ NAMES "dsound.h"
+ PATHS ${WINSDK_INCLUDE_DIRS} "${DXSDK_DIR}"
+ PATH_SUFFIXES include
+ DOC "The DirectSound include directory")
# DSOUND_LIBRARY
-if(CMAKE_CL_64)
- set (DirectX_ARCHITECTURE x64)
-else()
- set (DirectX_ARCHITECTURE x86)
-endif()
-
-file(GLOB DXSDK_LIB_DIRS LIST_DIRECTORIES TRUE "C:/Program Files (x86)/Windows Kits/10/Lib/*")
-if (DXSDK_LIB_DIRS)
- list(SORT DXSDK_LIB_DIRS)
- list(REVERSE DXSDK_LIB_DIRS)
-endif()
-
find_library(DSOUND_LIBRARY
NAMES dsound
+ PATHS ${WINSDK_LIB_DIRS} "${DXSDK_DIR}"
+ PATH_SUFFIXES lib lib/x86 lib/x64
DOC "The DirectSound library")
-if (NOT DSOUND_LIBRARY)
- find_library(DSOUND_LIBRARY
- NAMES dsound
- PATHS
- "${DXSDK_DIR}"
- ${DXSDK_LIB_DIRS}
- "C:/Program Files (x86)/Windows Kits/8.0"
- "C:/Program Files (x86)/Windows Kits/8.1"
- PATH_SUFFIXES
- Lib
- Lib/${DirectX_ARCHITECTURE}
- um/${DirectX_ARCHITECTURE}
- Lib/win8/um/${DirectX_ARCHITECTURE}
- Lib/winv6.3/um/${DirectX_ARCHITECTURE}
- DOC
- "The DirectSound library"
- )
-endif()
include(FindPackageHandleStandardArgs)
-find_package_handle_standard_args(DSound
- REQUIRED_VARS DSOUND_LIBRARY DSOUND_INCLUDE_DIR
-)
+find_package_handle_standard_args(DSound REQUIRED_VARS DSOUND_LIBRARY DSOUND_INCLUDE_DIR)
if(DSOUND_FOUND)
set(DSOUND_LIBRARIES ${DSOUND_LIBRARY})