VS2019 Compiler Identification is Unknown (Fresh Install VS2019 and CMAKE)

The C compiler identification could not be found in “C:/{snip}/CMakeFiles/3.19.5/CompilerIdC/CompilerIdC.exe”

The C compiler identification could not be found in “C:/{snip}/CMakeFiles/3.19.5/CompilerIdC/CompilerIdC.vcxproj”

Checking whether the C compiler is IAR using “” did not match “IAR .+ Compiler”:
Microsoft ® C/C++ Optimizing Compiler Version 19.28.29337 for x64
Copyright © Microsoft Corporation. All rights reserved.

usage: cl [ option… ] filename… [ /link linkoption… ]
Checking whether the C compiler is IAR using “” did not match “IAR .+ Compiler”:
Microsoft ® C/C++ Optimizing Compiler Version 19.28.29337 for x64
Copyright © Microsoft Corporation. All rights reserved.

usage: cl [ option… ] filename… [ /link linkoption… ]
The CXX compiler identification could not be found in “C:/{snip}/CMakeFiles/3.19.5/CompilerIdCXX/CompilerIdCXX.exe”

The CXX compiler identification could not be found in “C:/{snip}/CMakeFiles/3.19.5/CompilerIdCXX/CompilerIdCXX.vcxproj”

The CXX compiler identification could not be found in “C:/{snip}/CMakeFiles/3.19.5/CompilerIdCXX/CompilerIdCXX.exe”

The CXX compiler identification could not be found in “C:/{snip}/CMakeFiles/3.19.5/CompilerIdCXX/CompilerIdCXX.vcxproj”

Hmm. It looks like the VS installation might be incomplete? Did you install a toolchain?

Cc: @brad.king

If C:/{snip}/CMakeFiles/3.19.5/CompilerIdC/CompilerIdC.exe exists, please attach it here.

How are you invoking CMake?

FYI, for the Visual Studio 16 2019 generator you don’t need to run from any special environment. Be sure to use a fresh build tree on each attempt.

After some debugging I learned that the issue is related to being on a network drive. When I clone my repo onto the local C drive everything works as expected. However, when I am using a drive connected to my vmware-host// drive - the compiler is no longer detected.

Is this not supported maybe?

Note that my Guest OS is Windows 10 PRO and my Host OS is Fedora Linux, and my source files are mounted into my Win10 Guest from Linux. If there is support for this It would make my environment very nice to test code on multiple platforms.

(I start from fresh build files, meaning I definetly do not mix linux build files and windows build files. I only share the source files)

@brad.king

Does CMake work when source and build directory are on a SMB mount? When I build my CMake project on my local drive everything works as expected. However when I build my CMake project located on a network drive, my compilers are not detected. I’m not sure if this is an issue with CMake or if this is not supported?

FWIW, compiler identification also breaks for me when generating a project on a network drive (I’m running non-virtual Windows 10 and using VS 2017 generator). Funny thing is, I’m pretty certain this used to work for me some time (years?) ago - but I don’t remember if I was at Windows 7 or 10 at that time. Perhaps it has to do with Windows’ default approach of “everything network is super-scary and you should only touch it with a 10-foot pole if possible.”

I just mounted a SMB path on K:, and the following works fine:

K:\build>type ..\src\CMakeLists.txt
cmake_minimum_required(VERSION 3.19)
project(NetworkDrive)

K:\build>cmake ..\src -G "Visual Studio 16 2019"
...
-- Configuring done
-- Generating done
-- Build files have been written to: K:/build

I have VMWARE PRO with Windows 10 PRO Guest OS. I am building from the Guest OS. When the Build folder is on the shared folder - the compiler is not detected. When the build folder is on a local drive, the compiler is detected. So I can work with this since it doesn’t matter where my source files are. But it’s definitely interesting and no idea why. I can provide more logs if interested in learning why this doesn’t work. But in either case I am ok since I can work around this issue

I’m also seeing this with a VMWare VM, cmake 3.22.2, VS 2019. @brad.king Can you try that on a VMWare machine?