khanat-opennel-code/code/CMakeModules/FindDirectXSDK.cmake

66 lines
2 KiB
CMake
Raw Normal View History

2011-04-27 16:42:44 +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.
IF(DXSDK_DIR)
# Already in cache, be silent
SET(DXSDK_FIND_QUIETLY TRUE)
ENDIF(DXSDK_DIR)
FIND_PATH(DXSDK_DIR
"Include/dxsdkver.h"
PATHS
"$ENV{DXSDK_DIR}"
)
MACRO(FIND_DXSDK_LIBRARY MYLIBRARY MYLIBRARYNAME)
FIND_LIBRARY(${MYLIBRARY}
NAMES ${MYLIBRARYNAME}
PATHS
"${DXSDK_LIBRARY_DIR}"
"$ENV{DXSDK_DIR}"
"$ENV{DXSDK_DIR}/Lib"
"$ENV{DXSDK_DIR}/Lib/x86"
)
ENDMACRO(FIND_DXSDK_LIBRARY MYLIBRARY MYLIBRARYNAME)
IF(DXSDK_DIR)
SET(DXSDK_INCLUDE_DIR "${DXSDK_DIR}/Include")
2011-05-22 21:55:36 +00:00
IF(TARGET_X64)
2011-04-27 16:42:44 +00:00
SET(DXSDK_LIBRARY_DIR "${DXSDK_DIR}/Lib/x64")
2011-05-22 21:55:36 +00:00
ELSE(TARGET_X64)
2011-04-27 16:42:44 +00:00
SET(DXSDK_LIBRARY_DIR "${DXSDK_DIR}/Lib/x86")
2011-05-22 21:55:36 +00:00
ENDIF(TARGET_X64)
2011-04-27 16:42:44 +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)
#FIND_DXSDK_LIBRARY(DXSDK_MESH_LIBRARY mesh)
#FIND_DXSDK_LIBRARY(DXSDK_MAXUTIL_LIBRARY maxutil)
#FIND_DXSDK_LIBRARY(DXSDK_MAXSCRIPT_LIBRARY maxscrpt)
#FIND_DXSDK_LIBRARY(DXSDK_PARAMBLK2_LIBRARY paramblk2)
#FIND_DXSDK_LIBRARY(DXSDK_BMM_LIBRARY bmm)
ENDIF(DXSDK_DIR)
# Handle the QUIETLY and REQUIRED arguments and set DXSDK_FOUND to TRUE if
# all listed variables are TRUE.
INCLUDE(FindPackageHandleStandardArgs)
2011-05-22 21:55:36 +00:00
FIND_PACKAGE_HANDLE_STANDARD_ARGS(DirectXSDK DEFAULT_MSG DXSDK_DIR DXSDK_GUID_LIBRARY DXSDK_DINPUT_LIBRARY)
2011-04-27 16:42:44 +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)