[CMake] Visual Studio 2017 could not be found if installed in non-default location

HarpyWar harpywar at gmail.com
Tue Mar 28 09:17:32 EDT 2017


I did some tests on different Windows versions in virtual machines.
On a fresh Windows 10 (and installed Visual Studio 2017 Community) cmake
works fine and a compiler is found.
But on earlier versions: Windows 7, Windows 8.1, Windows Server 2012 -
cmake always fails with error

"The CXX compiler identification is unknown"


So, the problem is not in different installation path, but in wrong method
to find a compiler in earlier Windows.

Nils Gladitz, the command, which you proposed, return nothing, even on a
machine where a compiler found:
vswhere -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64
-requires Microsoft.VisualStudio.Component.Windows10SDK




On Mon, Mar 27, 2017 at 4:47 PM, Brad King <brad.king at kitware.com> wrote:

> On 03/27/2017 09:35 AM, Robert Maynard wrote:
> > So the real question is how did your compiler end up in the C drive
> > and not the alternative drive like mine. Do you run the visual studio
> > installer multiple times?
>
> Did you have any of the VS 15 preview versions installed previously?
>
> For reference, VS 2017 does not have any registry entries.  Instead
> the VS installer tool provides a COM interface that applications must
> use to ask for the location(s) of VS installations.  We do this in
> cmVSSetupHelper [1].
>
> -Brad
>
>
> [1] https://gitlab.kitware.com/cmake/cmake/blob/v3.8.0-rc3/Sourc
> e/cmVSSetupHelper.cxx
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/cmake/attachments/20170328/f678954b/attachment-0001.html>


More information about the CMake mailing list