mirror of
https://github.com/microsoft/vcpkg.git
synced 2025-01-18 11:43:02 +08:00
Add vcpkg_get_windows_sdk.cmake
This commit is contained in:
parent
a2cebceafe
commit
c44c085e8b
@ -16,3 +16,4 @@ include(vcpkg_copy_pdbs)
|
||||
include(vcpkg_copy_tool_dependencies)
|
||||
include(vcpkg_get_program_files_32_bit)
|
||||
include(vcpkg_get_program_files_platform_bitness)
|
||||
include(vcpkg_get_windows_sdk)
|
||||
|
15
scripts/cmake/vcpkg_get_windows_sdk.cmake
Normal file
15
scripts/cmake/vcpkg_get_windows_sdk.cmake
Normal file
@ -0,0 +1,15 @@
|
||||
function(vcpkg_get_windows_sdk ret)
|
||||
execute_process(
|
||||
COMMAND powershell.exe ${VCPKG_ROOT_DIR}/scripts/getWindowsSDK.ps1
|
||||
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()
|
Loading…
Reference in New Issue
Block a user