Skip to content
This repository was archived by the owner on Feb 25, 2021. It is now read-only.

Commit abd2dc7

Browse files
committed
Toolchain should be used too
1 parent f24bbf4 commit abd2dc7

1 file changed

Lines changed: 12 additions & 1 deletion

File tree

cmake/HunterGate.cmake

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -287,8 +287,19 @@ function(hunter_gate_download dir)
287287
endif()
288288

289289
hunter_gate_status_debug("Run generate")
290+
291+
# Need to add toolchain file too.
292+
# Otherwise on Visual Studio + MDD this will fail with error:
293+
# "Could not find an appropriate version of the Windows 10 SDK installed on this machine"
294+
if(EXISTS "${CMAKE_TOOLCHAIN_FILE}")
295+
set(toolchain_arg "-DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}")
296+
else()
297+
# 'toolchain_arg' can't be empty
298+
set(toolchain_arg "-DCMAKE_TOOLCHAIN_FILE=")
299+
endif()
300+
290301
execute_process(
291-
COMMAND "${CMAKE_COMMAND}" "-H${dir}" "-B${build_dir}" "-G${CMAKE_GENERATOR}"
302+
COMMAND "${CMAKE_COMMAND}" "-H${dir}" "-B${build_dir}" "-G${CMAKE_GENERATOR}" "${toolchain_arg}"
292303
WORKING_DIRECTORY "${dir}"
293304
RESULT_VARIABLE download_result
294305
${logging_params}

0 commit comments

Comments
 (0)