From 05ae23d1c4a516befab4377bddbd112771e6afef Mon Sep 17 00:00:00 2001 From: Prcuvu Date: Tue, 6 Oct 2015 15:34:36 +0800 Subject: [PATCH] Read DirectX SDK path from environment variable. --- CMake/Modules/FindDirectX.cmake | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/CMake/Modules/FindDirectX.cmake b/CMake/Modules/FindDirectX.cmake index 35be7fbbf3..bd6495a93e 100644 --- a/CMake/Modules/FindDirectX.cmake +++ b/CMake/Modules/FindDirectX.cmake @@ -10,20 +10,18 @@ if(NOT WIN32) return() endif() -# TODO: See if the paths listed below are enough. +if(NOT EXISTS "$ENV{DXSDK_DIR}") + message(FATAL_ERROR "Could not find Microsoft DirectX SDK installation!") +endif() set(DIRECTX_INCLUDE_SEARCH_PATHS # TODO: Do not be limited to x86 in the future. - "C:/Program Files (x86)/Microsoft DirectX SDK (June 2010)/Include" - "C:/DXSDK/Include" - "C:/Program Files (x86)/Microsoft DirectX SDK/Include" + "$ENV{DXSDK_DIR}/Include" ) set(DIRECTX_LIBRARY_SEARCH_PATHS # TODO: Do not be limited to x86 in the future. - "C:/Program Files (x86)/Microsoft DirectX SDK (June 2010)/Lib/x86" - "C:/DXSDK/Include/Lib/x86" - "C:/Program Files (x86)/Microsoft DirectX SDK/Lib/x86" + "$ENV{DXSDK_DIR}/Lib/x86" ) find_path(DIRECTX_INCLUDE_DIR