Problem
The 3.7.2 version of CMake bundled with Visual Studio 2017 (latest update) cannot on its own find the Visual Studio 2017 build tools.
This is reproducing for me using Visual Studio 2017 with individual components selected.
Using CMake 3.8.1 (current CMake release), the tools can be found no problem.
This becomes problematic when using the Visual Studio CMake tools because the ExternalProject_Add
macro
(used to include third-party CMake driven projects) re-invokes CMake, at which point it fails to find the compilers.
It seems that Visual Studio originally invokes CMake "specially" shomehow as it finds the tools for the top-level project,
but does not retain this environment when ${CMAKE_COMMAND}
is invoked from within the build.