summaryrefslogtreecommitdiffstats
path: root/cmake
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2014-04-19 07:49:27 -0700
committerChris Robinson <[email protected]>2014-04-19 07:49:27 -0700
commit96c559fbefd3a98068ac9e1ff66b88278d8ed8a2 (patch)
treeff09d19129eeb4290c6f38e544bd9135b5a81e37 /cmake
parent887763e41c953b91105bba119da7a7265815f5e0 (diff)
Use a find module to look for DirectSound
Diffstat (limited to 'cmake')
-rw-r--r--cmake/FindDSound.cmake33
1 files changed, 33 insertions, 0 deletions
diff --git a/cmake/FindDSound.cmake b/cmake/FindDSound.cmake
new file mode 100644
index 00000000..36cdf4b5
--- /dev/null
+++ b/cmake/FindDSound.cmake
@@ -0,0 +1,33 @@
+# - Find DirectSound includes and libraries
+#
+# DSOUND_FOUND - True if DSOUND_INCLUDE_DIR & DSOUND_LIBRARY are found
+# DSOUND_LIBRARIES - Set when DSOUND_LIBRARY is found
+# DSOUND_INCLUDE_DIRS - Set when DSOUND_INCLUDE_DIR is found
+#
+# DSOUND_INCLUDE_DIR - where to find dsound.h, etc.
+# DSOUND_LIBRARY - the dsound library
+#
+
+find_path(DSOUND_INCLUDE_DIR
+ PATHS "${DXSDK_DIR}/include"
+ NAMES dsound.h
+ DOC "The DirectSound include directory"
+)
+
+find_library(DSOUND_LIBRARY
+ PATHS "${DXSDK_DIR}/lib"
+ NAMES dsound
+ DOC "The DirectSound library"
+)
+
+include(FindPackageHandleStandardArgs)
+find_package_handle_standard_args(DSound
+ REQUIRED_VARS DSOUND_LIBRARY DSOUND_INCLUDE_DIR
+)
+
+if(DSOUND_FOUND)
+ set(DSOUND_LIBRARIES ${DSOUND_LIBRARY})
+ set(DSOUND_INCLUDE_DIRS ${DSOUND_INCLUDE_DIR})
+endif()
+
+mark_as_advanced(DSOUND_INCLUDE_DIR DSOUND_LIBRARY)