From 9c37e0f07784b8e3f56bb3313c23c91adac65f70 Mon Sep 17 00:00:00 2001 From: StudioEtrange Date: Fri, 21 Feb 2014 16:40:04 +0100 Subject: [PATCH 2/3] Fix bug cannot find right include folder for winsdk8 --- code/CMakeModules/FindWindowsSDK.cmake | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/code/CMakeModules/FindWindowsSDK.cmake b/code/CMakeModules/FindWindowsSDK.cmake index fd32d92b5..036e730d5 100644 --- a/code/CMakeModules/FindWindowsSDK.cmake +++ b/code/CMakeModules/FindWindowsSDK.cmake @@ -71,11 +71,14 @@ SET(WINSDKENV_DIR $ENV{WINSDK_DIR}) MACRO(FIND_WINSDK_VERSION_HEADERS) IF(WINSDK_DIR AND NOT WINSDK_VERSION) # Search version in headers - IF(EXISTS ${WINSDK_DIR}/include/Msi.h) - SET(_MSI_FILE ${WINSDK_DIR}/include/Msi.h) - ENDIF(EXISTS ${WINSDK_DIR}/include/Msi.h) + FIND_FILE(_MSI_FILE Msi.h + PATHS + ${WINSDK_DIR}/Include/um + ${WINSDK_DIR}/Include + ) IF(_MSI_FILE) + # Look for Windows SDK 8.0 FILE(STRINGS ${_MSI_FILE} _CONTENT REGEX "^#ifndef NTDDI_WIN8") @@ -88,11 +91,11 @@ MACRO(FIND_WINSDK_VERSION_HEADERS) FILE(STRINGS ${_MSI_FILE} _CONTENT REGEX "^#ifndef NTDDI_WIN7") IF(_CONTENT) - IF(EXISTS ${WINSDK_DIR}/include/winsdkver.h) - SET(_WINSDKVER_FILE ${WINSDK_DIR}/include/winsdkver.h) - ELSEIF(EXISTS ${WINSDK_DIR}/include/WinSDKVer.h) - SET(_WINSDKVER_FILE ${WINSDK_DIR}/include/WinSDKVer.h) - ENDIF(EXISTS ${WINSDK_DIR}/include/winsdkver.h) + FIND_FILE(_WINSDKVER_FILE winsdkver.h WinSDKVer.h + PATHS + ${WINSDK_DIR}/Include/um + ${WINSDK_DIR}/Include + ) IF(_WINSDKVER_FILE) # Load WinSDKVer.h content @@ -173,7 +176,7 @@ MACRO(USE_CURRENT_WINSDK) # Look for Windows.h because there are several paths IF(EXISTS ${_INCLUDE}/Windows.h) - STRING(REGEX REPLACE "/(include|INCLUDE|Include)" "" WINSDK_DIR ${_INCLUDE}) + STRING(REGEX REPLACE "/(include|INCLUDE|Include)(.*)" "" WINSDK_DIR ${_INCLUDE}) MESSAGE(STATUS "Found Windows SDK environment variable in ${WINSDK_DIR}") BREAK() ENDIF(EXISTS ${_INCLUDE}/Windows.h) From 8c5094817b6ad8054148f100fda2d30e3296a385 Mon Sep 17 00:00:00 2001 From: StudioEtrange Date: Fri, 21 Feb 2014 17:35:15 +0100 Subject: [PATCH 3/3] fix find windows.h for winsdk8 --- code/CMakeModules/FindWindowsSDK.cmake | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/code/CMakeModules/FindWindowsSDK.cmake b/code/CMakeModules/FindWindowsSDK.cmake index 036e730d5..2e72af9e5 100644 --- a/code/CMakeModules/FindWindowsSDK.cmake +++ b/code/CMakeModules/FindWindowsSDK.cmake @@ -165,9 +165,13 @@ MACRO(USE_CURRENT_WINSDK) SET(WINSDK_VERSION_FULL "") # Use WINSDK environment variable - IF(WINSDKENV_DIR AND EXISTS ${WINSDKENV_DIR}/include/Windows.h) - SET(WINSDK_DIR ${WINSDKENV_DIR}) - ENDIF(WINSDKENV_DIR AND EXISTS ${WINSDKENV_DIR}/include/Windows.h) + IF(WINSDKENV_DIR) + FIND_PATH(WINSDK_DIR Windows.h + HINTS + ${WINSDKENV_DIR}/Include/um + ${WINSDKENV_DIR}/Include + ) + ENDIF(WINSDKENV_DIR) # Use INCLUDE environment variable IF(NOT WINSDK_DIR AND WINSDKCURRENT_VERSION_INCLUDE) @@ -177,7 +181,7 @@ MACRO(USE_CURRENT_WINSDK) # Look for Windows.h because there are several paths IF(EXISTS ${_INCLUDE}/Windows.h) STRING(REGEX REPLACE "/(include|INCLUDE|Include)(.*)" "" WINSDK_DIR ${_INCLUDE}) - MESSAGE(STATUS "Found Windows SDK environment variable in ${WINSDK_DIR}") + MESSAGE(STATUS "Found Windows SDK from include environment variable in ${WINSDK_DIR}") BREAK() ENDIF(EXISTS ${_INCLUDE}/Windows.h) ENDFOREACH(_INCLUDE)