Use Windows SDK if DirectX SDK not installed

feature/hunter
Nimetu 3 years ago
parent 81212fd728
commit 50c4dba593

@ -501,6 +501,17 @@ IF(WINSDK_INCLUDE_DIR)
IF(WINSDK_VERSION STREQUAL "7.1" AND (MSVC11 OR MSVC12 OR MSVC14))
ADD_DEFINITIONS(-D_USING_V110_SDK71_)
ENDIF()
IF(NOT DXSDK_DIR)
MESSAGE("Using DirectX from Windows SDK (${WINSDK_LIBRARY_DIRS})")
SET(DXSDK_DIR ${WINSDK_DIR})
FIND_LIBRARY(DXSDK_GUID_LIBRARY dxguid ${WINSDK_LIBRARY_DIRS})
FIND_LIBRARY(DXSDK_DINPUT_LIBRARY dinput8 ${WINSDK_LIBRARY_DIRS})
FIND_LIBRARY(DXSDK_DSOUND_LIBRARY dsound ${WINSDK_LIBRARY_DIRS})
FIND_LIBRARY(DXSDK_XAUDIO_LIBRARY xaudio2 ${WINSDK_LIBRARY_DIRS})
# TODO: FIND_LIBRARY(DXSDK_D3DX9_LIBRARY d3dx9)
FIND_LIBRARY(DXSDK_D3D9_LIBRARY d3d9 ${WINSDK_LIBRARY_DIRS})
ENDIF()
ELSE()
IF(NOT WindowsSDK_FIND_QUIETLY)
MESSAGE(STATUS "Warning: Unable to find Windows SDK!")

@ -1280,7 +1280,7 @@ MACRO(SETUP_EXTERNAL)
IF(WIN32)
# Must include DXSDK before WINSDK
FIND_PACKAGE(DirectXSDK REQUIRED)
FIND_PACKAGE(DirectXSDK)
# IF(DXSDK_INCLUDE_DIR)
# INCLUDE_DIRECTORIES(${DXSDK_INCLUDE_DIR})
# ENDIF()
@ -1289,5 +1289,8 @@ MACRO(SETUP_EXTERNAL)
IF(MSVC)
FIND_PACKAGE(MSVC REQUIRED)
FIND_PACKAGE(WindowsSDK REQUIRED)
IF(NOT DXSDK_DIR)
MESSAGE(FATAL_ERROR "DirectX SDK or DirectX files from Windows SDK not found.")
ENDIF()
ENDIF()
ENDMACRO()

Loading…
Cancel
Save