You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
70 lines
2.1 KiB
CMake
70 lines
2.1 KiB
CMake
15 years ago
|
# - 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.
|
||
|
|
||
14 years ago
|
IF(DXSDK_DIR)
|
||
12 years ago
|
# Already in cache, be silent
|
||
|
SET(DXSDK_FIND_QUIETLY TRUE)
|
||
8 years ago
|
ENDIF()
|
||
15 years ago
|
|
||
14 years ago
|
FIND_PATH(DXSDK_DIR
|
||
|
"Include/dxsdkver.h"
|
||
15 years ago
|
PATHS
|
||
14 years ago
|
"$ENV{DXSDK_DIR}"
|
||
13 years ago
|
"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"
|
||
15 years ago
|
)
|
||
|
|
||
|
MACRO(FIND_DXSDK_LIBRARY MYLIBRARY MYLIBRARYNAME)
|
||
|
FIND_LIBRARY(${MYLIBRARY}
|
||
12 years ago
|
NAMES ${MYLIBRARYNAME}
|
||
11 years ago
|
HINTS
|
||
12 years ago
|
"${DXSDK_LIBRARY_DIR}"
|
||
|
)
|
||
9 years ago
|
ENDMACRO()
|
||
15 years ago
|
|
||
14 years ago
|
IF(DXSDK_DIR)
|
||
|
SET(DXSDK_INCLUDE_DIR "${DXSDK_DIR}/Include")
|
||
15 years ago
|
|
||
14 years ago
|
IF(TARGET_X64)
|
||
11 years ago
|
SET(DXSDK_LIBRARY_DIRS ${DXSDK_DIR}/Lib/x64 ${DXSDK_DIR}/lib/amd64)
|
||
9 years ago
|
ELSE()
|
||
11 years ago
|
SET(DXSDK_LIBRARY_DIRS ${DXSDK_DIR}/Lib/x86 ${DXSDK_DIR}/lib)
|
||
9 years ago
|
ENDIF()
|
||
14 years ago
|
|
||
11 years ago
|
FIND_PATH(DXSDK_LIBRARY_DIR
|
||
|
dxguid.lib
|
||
|
PATHS
|
||
|
${DXSDK_LIBRARY_DIRS})
|
||
|
|
||
14 years ago
|
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)
|
||
9 years ago
|
ENDIF()
|
||
15 years ago
|
|
||
|
# Handle the QUIETLY and REQUIRED arguments and set DXSDK_FOUND to TRUE if
|
||
|
# all listed variables are TRUE.
|
||
14 years ago
|
INCLUDE(FindPackageHandleStandardArgs)
|
||
|
|
||
14 years ago
|
FIND_PACKAGE_HANDLE_STANDARD_ARGS(DirectXSDK DEFAULT_MSG DXSDK_DIR DXSDK_GUID_LIBRARY DXSDK_DINPUT_LIBRARY)
|
||
14 years ago
|
|
||
|
MARK_AS_ADVANCED(DXSDK_INCLUDE_DIR
|
||
|
DXSDK_GUID_LIBRARY
|
||
|
DXSDK_DINPUT_LIBRARY
|
||
|
DXSDK_DSOUND_LIBRARY
|
||
|
DXSDK_XAUDIO_LIBRARY
|
||
|
DXSDK_D3DX9_LIBRARY
|
||
|
DXSDK_D3D9_LIBRARY)
|