2010-09-14 21:10:25 +00:00
|
|
|
# - Find Windows Platform SDK
|
|
|
|
# Find the Windows includes
|
|
|
|
#
|
|
|
|
# WINSDK_INCLUDE_DIR - where to find Windows.h
|
2012-12-06 09:23:04 +00:00
|
|
|
# WINSDK_INCLUDE_DIRS - where to find all Windows headers
|
|
|
|
# WINSDK_LIBRARY_DIR - where to find libraries
|
2010-09-14 21:10:25 +00:00
|
|
|
# WINSDK_FOUND - True if Windows SDK found.
|
|
|
|
|
|
|
|
IF(WINSDK_INCLUDE_DIR)
|
|
|
|
# Already in cache, be silent
|
2012-12-06 09:23:04 +00:00
|
|
|
SET(WindowsSDK_FIND_QUIETLY TRUE)
|
2010-09-14 21:10:25 +00:00
|
|
|
ENDIF(WINSDK_INCLUDE_DIR)
|
|
|
|
|
2012-12-06 09:23:04 +00:00
|
|
|
# TODO: add the possibility to use a specific Windows SDK
|
|
|
|
|
|
|
|
IF(MSVC11)
|
|
|
|
GET_FILENAME_COMPONENT(WINSDK8_DIR "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Microsoft SDKs\\Windows\\v8.0;InstallationFolder]" ABSOLUTE CACHE)
|
|
|
|
GET_FILENAME_COMPONENT(WINSDK8_VERSION "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Microsoft SDKs\\Windows\\v8.0;ProductVersion]" NAME)
|
|
|
|
|
|
|
|
IF(WINSDK8_DIR)
|
|
|
|
IF(NOT WindowsSDK_FIND_QUIETLY)
|
|
|
|
MESSAGE(STATUS "Found Windows SDK ${WINSDK8_VERSION} in ${WINSDK8_DIR}")
|
|
|
|
ENDIF(NOT WindowsSDK_FIND_QUIETLY)
|
|
|
|
IF(TARGET_ARM)
|
|
|
|
SET(WINSDK8_SUFFIX "arm")
|
|
|
|
ELSEIF(TARGET_X64)
|
|
|
|
SET(WINSDK8_SUFFIX "x64")
|
|
|
|
ELSEIF(TARGET_X86)
|
|
|
|
SET(WINSDK8_SUFFIX "x86")
|
|
|
|
ENDIF(TARGET_ARM)
|
|
|
|
ENDIF(WINSDK8_DIR)
|
|
|
|
ENDIF(MSVC11)
|
|
|
|
|
2011-05-14 11:58:39 +00:00
|
|
|
GET_FILENAME_COMPONENT(WINSDK71_DIR "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Microsoft SDKs\\Windows\\v7.1;InstallationFolder]" ABSOLUTE CACHE)
|
|
|
|
GET_FILENAME_COMPONENT(WINSDK71_VERSION "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Microsoft SDKs\\Windows\\v7.1;ProductVersion]" NAME)
|
|
|
|
|
|
|
|
IF(WINSDK71_DIR)
|
2012-12-06 09:23:04 +00:00
|
|
|
IF(NOT WindowsSDK_FIND_QUIETLY)
|
2011-05-14 11:58:39 +00:00
|
|
|
MESSAGE(STATUS "Found Windows SDK ${WINSDK71_VERSION} in ${WINSDK71_DIR}")
|
2012-12-06 09:23:04 +00:00
|
|
|
ENDIF(NOT WindowsSDK_FIND_QUIETLY)
|
2011-05-14 11:58:39 +00:00
|
|
|
ENDIF(WINSDK71_DIR)
|
|
|
|
|
|
|
|
GET_FILENAME_COMPONENT(WINSDKCURRENT_DIR "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Microsoft SDKs\\Windows;CurrentInstallFolder]" ABSOLUTE CACHE)
|
|
|
|
GET_FILENAME_COMPONENT(WINSDKCURRENT_VERSION "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Microsoft SDKs\\Windows;CurrentVersion]" NAME)
|
|
|
|
|
|
|
|
IF(WINSDKCURRENT_DIR)
|
2012-12-06 09:23:04 +00:00
|
|
|
IF(NOT WindowsSDK_FIND_QUIETLY)
|
2011-05-14 11:58:39 +00:00
|
|
|
MESSAGE(STATUS "Found Windows SDK ${WINSDKCURRENT_VERSION} in ${WINSDKCURRENT_DIR}")
|
2012-12-06 09:23:04 +00:00
|
|
|
ENDIF(NOT WindowsSDK_FIND_QUIETLY)
|
2011-05-14 11:58:39 +00:00
|
|
|
ENDIF(WINSDKCURRENT_DIR)
|
|
|
|
|
2010-09-14 21:10:25 +00:00
|
|
|
FIND_PATH(WINSDK_INCLUDE_DIR Windows.h
|
2012-12-06 09:23:04 +00:00
|
|
|
HINTS
|
|
|
|
${WINSDK8_DIR}/Include/um
|
2011-05-14 11:58:39 +00:00
|
|
|
${WINSDK71_DIR}/Include
|
|
|
|
${WINSDKCURRENT_DIR}/Include
|
2010-09-14 21:10:25 +00:00
|
|
|
)
|
|
|
|
|
2012-12-06 09:23:04 +00:00
|
|
|
FIND_PATH(WINSDK_SHARED_INCLUDE_DIR d3d9.h
|
|
|
|
HINTS
|
|
|
|
${WINSDK8_DIR}/Include/shared
|
|
|
|
${WINSDK71_DIR}/Include
|
|
|
|
${WINSDKCURRENT_DIR}/Include
|
|
|
|
)
|
|
|
|
|
|
|
|
FIND_PATH(WINSDK_LIBRARY_DIR ComCtl32.lib
|
|
|
|
HINTS
|
|
|
|
${WINSDK8_DIR}/Lib/win8/um/${WINSDK8_SUFFIX}
|
|
|
|
${WINSDK71_DIR}/Lib
|
|
|
|
${WINSDKCURRENT_DIR}/Lib
|
|
|
|
)
|
|
|
|
|
2011-08-19 14:58:18 +00:00
|
|
|
FIND_PROGRAM(WINSDK_SIGNTOOL signtool
|
2012-12-06 09:23:04 +00:00
|
|
|
HINTS
|
|
|
|
${WINSDK8_DIR}/Bin/x86
|
2011-08-19 14:58:18 +00:00
|
|
|
${WINSDK71_DIR}/Bin
|
|
|
|
${WINSDKCURRENT_DIR}/Bin
|
|
|
|
)
|
|
|
|
|
2010-09-14 21:10:25 +00:00
|
|
|
IF(WINSDK_INCLUDE_DIR)
|
2010-09-25 13:41:37 +00:00
|
|
|
SET(WINSDK_FOUND TRUE)
|
2012-12-06 09:23:04 +00:00
|
|
|
SET(WINSDK_INCLUDE_DIRS ${WINSDK_INCLUDE_DIR} ${WINSDK_SHARED_INCLUDE_DIR})
|
2010-09-14 21:10:25 +00:00
|
|
|
ELSE(WINSDK_INCLUDE_DIR)
|
2012-12-06 09:23:04 +00:00
|
|
|
IF(NOT WindowsSDK_FIND_QUIETLY)
|
2010-09-14 21:10:25 +00:00
|
|
|
MESSAGE(STATUS "Warning: Unable to find Windows SDK!")
|
2012-12-06 09:23:04 +00:00
|
|
|
ENDIF(NOT WindowsSDK_FIND_QUIETLY)
|
2010-09-14 21:10:25 +00:00
|
|
|
ENDIF(WINSDK_INCLUDE_DIR)
|