I have a project that I have natively compiled/built under VS 2019 (CL.exe, MSBuild.exe via .vcxproj and .sln files). I am able to build this under CMake as well when the generator is set to Ninja.
However, when the generator is set to Visual Studio 16 2019 Win 64 via changes to CMakeSettings.json, I obtain the following error from the following line on my CML.txt
project (“CMakeProject” LANGUAGES C CXX)
The error is: No CMAKE_CXX_COMPILER could be found. (Same error appears for C compiler as well since I have specified languages as C and CXX)
The CMakeOutput.log file says:
The system is: Windows - 10.0.19045 - AMD64
I am unable to upload the CMakeError.log file as I am a new user. Could you please let me know how I could share that with the forum?
Could you please help fix this error? I would like to compare the .vcxproj created natively by Visual Studio IDE and compare that with the .vcxproj file CMake generates.
Thank you.
ETA: When the generator is set to Ninja, everything works without error and I am able to see the following in the Visual Studio IDE’s output box for CMake:
1> [CMake] – The C compiler identification is MSVC 19.29.30147.0
1> [CMake] – The CXX compiler identification is MSVC 19.29.30147.0
The linked error log shows this error from MSBuild:
error MSB6003: The specified task executable "CL.exe" could not be run. System.IO.DirectoryNotFoundException: Could not find a part of the path '...'
The path to the build tree is pretty long and may be exceeding the limit of some VS tooling. It also contains characters like @ and , in path components.