2010-05-06 00:08:41 +00:00
|
|
|
# - Find DirectX
|
|
|
|
# Find the DirectX includes and libraries
|
|
|
|
#
|
|
|
|
# DXSDK_INCLUDE_DIR - where to find baseinterface.h
|
|
|
|
# DXSDK_LIBRARIES - List of libraries when using 3DSMAX.
|
|
|
|
# DXSDK_FOUND - True if MAX SDK found.
|
|
|
|
|
2010-09-25 15:10:32 +00:00
|
|
|
IF(DXSDK_DIR)
|
2013-08-05 08:34:38 +00:00
|
|
|
# Already in cache, be silent
|
|
|
|
SET(DXSDK_FIND_QUIETLY TRUE)
|
2010-09-25 15:10:32 +00:00
|
|
|
ENDIF(DXSDK_DIR)
|
2010-05-06 00:08:41 +00:00
|
|
|
|
2010-09-25 15:10:32 +00:00
|
|
|
FIND_PATH(DXSDK_DIR
|
|
|
|
"Include/dxsdkver.h"
|
2010-05-06 00:08:41 +00:00
|
|
|
PATHS
|
2010-09-25 15:10:32 +00:00
|
|
|
"$ENV{DXSDK_DIR}"
|
2012-02-21 16:47:16 +00:00
|
|
|
"C:/Program Files (x86)/Microsoft DirectX SDK (June 2010)"
|
|
|
|
"C:/Program Files/Microsoft DirectX SDK (June 2010)"
|
|
|
|
"C:/Program Files (x86)/Microsoft DirectX SDK (February 2010)"
|
|
|
|
"C:/Program Files/Microsoft DirectX SDK (February 2010)"
|
|
|
|
"C:/Program Files (x86)/Microsoft DirectX SDK (November 2007)"
|
|
|
|
"C:/Program Files/Microsoft DirectX SDK (November 2007)"
|
|
|
|
"C:/Program Files (x86)/Microsoft DirectX SDK"
|
|
|
|
"C:/Program Files/Microsoft DirectX SDK"
|
2010-05-06 00:08:41 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
MACRO(FIND_DXSDK_LIBRARY MYLIBRARY MYLIBRARYNAME)
|
|
|
|
FIND_LIBRARY(${MYLIBRARY}
|
2013-08-05 08:34:38 +00:00
|
|
|
NAMES ${MYLIBRARYNAME}
|
2014-04-11 15:56:26 +00:00
|
|
|
HINTS
|
2013-08-05 08:34:38 +00:00
|
|
|
"${DXSDK_LIBRARY_DIR}"
|
|
|
|
)
|
2010-05-06 00:08:41 +00:00
|
|
|
ENDMACRO(FIND_DXSDK_LIBRARY MYLIBRARY MYLIBRARYNAME)
|
|
|
|
|
2010-09-25 15:10:32 +00:00
|
|
|
IF(DXSDK_DIR)
|
|
|
|
SET(DXSDK_INCLUDE_DIR "${DXSDK_DIR}/Include")
|
2010-05-06 00:08:41 +00:00
|
|
|
|
2011-05-14 12:05:31 +00:00
|
|
|
IF(TARGET_X64)
|
2014-04-11 15:56:26 +00:00
|
|
|
SET(DXSDK_LIBRARY_DIRS ${DXSDK_DIR}/Lib/x64 ${DXSDK_DIR}/lib/amd64)
|
2011-05-14 12:05:31 +00:00
|
|
|
ELSE(TARGET_X64)
|
2014-04-11 15:56:26 +00:00
|
|
|
SET(DXSDK_LIBRARY_DIRS ${DXSDK_DIR}/Lib/x86 ${DXSDK_DIR}/lib)
|
2011-05-14 12:05:31 +00:00
|
|
|
ENDIF(TARGET_X64)
|
2010-09-25 15:10:32 +00:00
|
|
|
|
2014-04-11 15:56:26 +00:00
|
|
|
FIND_PATH(DXSDK_LIBRARY_DIR
|
|
|
|
dxguid.lib
|
|
|
|
PATHS
|
|
|
|
${DXSDK_LIBRARY_DIRS})
|
|
|
|
|
2010-09-25 15:10:32 +00:00
|
|
|
FIND_DXSDK_LIBRARY(DXSDK_GUID_LIBRARY dxguid)
|
|
|
|
FIND_DXSDK_LIBRARY(DXSDK_DINPUT_LIBRARY dinput8)
|
|
|
|
FIND_DXSDK_LIBRARY(DXSDK_DSOUND_LIBRARY dsound)
|
|
|
|
FIND_DXSDK_LIBRARY(DXSDK_XAUDIO_LIBRARY x3daudio)
|
|
|
|
FIND_DXSDK_LIBRARY(DXSDK_D3DX9_LIBRARY d3dx9)
|
|
|
|
FIND_DXSDK_LIBRARY(DXSDK_D3D9_LIBRARY d3d9)
|
|
|
|
ENDIF(DXSDK_DIR)
|
2010-05-06 00:08:41 +00:00
|
|
|
|
|
|
|
# Handle the QUIETLY and REQUIRED arguments and set DXSDK_FOUND to TRUE if
|
|
|
|
# all listed variables are TRUE.
|
2010-09-25 15:10:32 +00:00
|
|
|
INCLUDE(FindPackageHandleStandardArgs)
|
|
|
|
|
2011-05-14 12:05:31 +00:00
|
|
|
FIND_PACKAGE_HANDLE_STANDARD_ARGS(DirectXSDK DEFAULT_MSG DXSDK_DIR DXSDK_GUID_LIBRARY DXSDK_DINPUT_LIBRARY)
|
2010-09-25 15:10:32 +00:00
|
|
|
|
|
|
|
MARK_AS_ADVANCED(DXSDK_INCLUDE_DIR
|
|
|
|
DXSDK_GUID_LIBRARY
|
|
|
|
DXSDK_DINPUT_LIBRARY
|
|
|
|
DXSDK_DSOUND_LIBRARY
|
|
|
|
DXSDK_XAUDIO_LIBRARY
|
|
|
|
DXSDK_D3DX9_LIBRARY
|
|
|
|
DXSDK_D3D9_LIBRARY)
|