Browse Source

Merge pull request #344 from Hoikas/cmake

FindDirectX Improvements
Michael Hansen 11 years ago
parent
commit
cf78792155
  1. 34
      cmake/FindDirectX.cmake

34
cmake/FindDirectX.cmake

@ -9,46 +9,46 @@ if(DirectX_INCLUDE_DIR)
set(DirectX_FIND_QUIETLY TRUE) set(DirectX_FIND_QUIETLY TRUE)
endif() endif()
# Figure out the arch for the path suffixes
if(CMAKE_SIZEOF_VOID_P MATCHES "8")
set(_dxarch "x64")
else()
set(_dxarch "x86")
endif()
find_path(DirectX_INCLUDE_DIR d3dx9.h find_path(DirectX_INCLUDE_DIR d3dx9.h
$ENV{DXSDK_DIR}/Include PATHS "$ENV{DXSDK_DIR}/Include"
) )
find_library(DirectX_d3d9 NAMES d3d9 find_library(DirectX_d3d9 NAMES d3d9
PATHS $ENV{DXSDK_DIR}/Lib/x86 PATHS "$ENV{DXSDK_DIR}/Lib/${_dxarch}"
PATHS $ENV{DXSDK_DIR}/Lib/x64
) )
find_library(DirectX_d3dx9 NAMES d3dx9 find_library(DirectX_d3dx9 NAMES d3dx9
PATHS $ENV{DXSDK_DIR}/Lib/x86 PATHS "$ENV{DXSDK_DIR}/Lib/${_dxarch}"
PATHS $ENV{DXSDK_DIR}/Lib/x64
) )
find_library(DirectX_dinput8 NAMES dinput8 find_library(DirectX_dinput8 NAMES dinput8
PATHS $ENV{DXSDK_DIR}/Lib/x86 PATHS "$ENV{DXSDK_DIR}/Lib/${_dxarch}"
PATHS $ENV{DXSDK_DIR}/Lib/x64
) )
find_library(DirectX_dsound NAMES dsound find_library(DirectX_dsound NAMES dsound
PATHS $ENV{DXSDK_DIR}/Lib/x86 PATHS "$ENV{DXSDK_DIR}/Lib/${_dxarch}"
PATHS $ENV{DXSDK_DIR}/Lib/x64
) )
find_library(DirectX_dxguid NAMES dxguid find_library(DirectX_dxguid NAMES dxguid
PATHS $ENV{DXSDK_DIR}/Lib/x86 PATHS "$ENV{DXSDK_DIR}/Lib/${_dxarch}"
PATHS $ENV{DXSDK_DIR}/Lib/x64
) )
if (DirectX_OLD_SDK) if (DirectX_OLD_SDK)
find_library(DirectX_dxerr NAMES dxerr9 find_library(DirectX_dxerr NAMES dxerr9
PATHS $ENV{DXSDK_DIR}/Lib/x86 PATHS "$ENV{DXSDK_DIR}/Lib/${_dxarch}"
PATHS $ENV{DXSDK_DIR}/Lib/x64
) )
else() else()
find_library(DirectX_dxerr NAMES DxErr find_library(DirectX_dxerr NAMES DxErr
PATHS $ENV{DXSDK_DIR}/Lib/x86 PATHS "$ENV{DXSDK_DIR}/Lib/${_dxarch}"
PATHS $ENV{DXSDK_DIR}/Lib/x64 )
)
endif(DirectX_OLD_SDK) endif(DirectX_OLD_SDK)
set(DirectX_LIBRARIES set(DirectX_LIBRARIES

Loading…
Cancel
Save