vcpkg/scripts/cmake/vcpkg_get_windows_sdk.cmake

14 lines
509 B
CMake
Raw Normal View History

2017-02-21 18:09:32 -08:00
function(vcpkg_get_windows_sdk ret)
execute_process(
2017-03-15 16:24:45 -07:00
COMMAND powershell.exe -NoProfile -ExecutionPolicy Bypass -Command "& {& '${VCPKG_ROOT_DIR}/scripts/getWindowsSDK.ps1'}" 2>&1
2017-02-21 18:09:32 -08:00
OUTPUT_VARIABLE WINDOWS_SDK
RESULT_VARIABLE error_code)
if (${error_code})
message(FATAL_ERROR "Could not find Windows SDK")
endif()
# Remove trailing newline
string(REGEX REPLACE "\n$" "" WINDOWS_SDK "${WINDOWS_SDK}")
set(${ret} ${WINDOWS_SDK} PARENT_SCOPE)
endfunction()