From 4fee35c5b36ef8597ef3b99af3717f003f3080f0 Mon Sep 17 00:00:00 2001 From: kervala Date: Fri, 27 Sep 2013 09:26:22 +0200 Subject: [PATCH] Fixed: Windows SDK detection for some previous versions --- code/CMakeModules/FindWindowsSDK.cmake | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/code/CMakeModules/FindWindowsSDK.cmake b/code/CMakeModules/FindWindowsSDK.cmake index 4b8556398..5e0724581 100644 --- a/code/CMakeModules/FindWindowsSDK.cmake +++ b/code/CMakeModules/FindWindowsSDK.cmake @@ -63,8 +63,10 @@ ENDIF(TARGET_ARM) GET_FILENAME_COMPONENT(WINSDKCURRENT_VERSION_REGISTRY "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Microsoft SDKs\\Windows;CurrentVersion]" NAME) IF(WINSDKCURRENT_VERSION_REGISTRY AND NOT WINSDKCURRENT_VERSION_REGISTRY STREQUAL "/registry") + # For previous Windows SDK, version used the short version prefixed by a "v" + STRING(REPLACE "v" "" WINSDKCURRENT_VERSION_REGISTRY ${WINSDKCURRENT_VERSION_REGISTRY}) IF(NOT WindowsSDK_FIND_QUIETLY) -# MESSAGE(STATUS "Current version is ${WINSDKCURRENT_VERSION_REGISTRY}") + MESSAGE(STATUS "Current version in registry is ${WINSDKCURRENT_VERSION_REGISTRY}") ENDIF(NOT WindowsSDK_FIND_QUIETLY) ENDIF(WINSDKCURRENT_VERSION_REGISTRY AND NOT WINSDKCURRENT_VERSION_REGISTRY STREQUAL "/registry") @@ -210,12 +212,12 @@ MACRO(USE_CURRENT_WINSDK) # Look for correct registered Windows SDK version FOREACH(_VERSION ${WINSDK_DETECTED_VERSIONS}) - IF(WINSDKCURRENT_VERSION_REGISTRY STREQUAL WINSDK${_VERSION}_VERSION_FULL) + IF(WINSDKCURRENT_VERSION_REGISTRY STREQUAL WINSDK${_VERSION}_VERSION_FULL OR WINSDKCURRENT_VERSION_REGISTRY STREQUAL _VERSION) SET(WINSDK_VERSION ${_VERSION}) SET(WINSDK_VERSION_FULL "${WINSDK${WINSDK_VERSION}_VERSION_FULL}") SET(WINSDK_DIR "${WINSDK${WINSDK_VERSION}_DIR}") BREAK() - ENDIF(WINSDKCURRENT_VERSION_REGISTRY STREQUAL WINSDK${_VERSION}_VERSION_FULL) + ENDIF(WINSDKCURRENT_VERSION_REGISTRY STREQUAL WINSDK${_VERSION}_VERSION_FULL OR WINSDKCURRENT_VERSION_REGISTRY STREQUAL _VERSION) ENDFOREACH(_VERSION) ENDIF(NOT WINSDK_DIR AND WINSDKCURRENT_VERSION_REGISTRY) ENDMACRO(USE_CURRENT_WINSDK)