Reputation: 17173
I am using Visual Studio with C++.
For a particular reason, I now need to use CMake to build a piece of the project. I would like to tell CMake to use the same compiler I normally use with Visual Studio.
How can I find the exact cl.exe
compiler executable path used by Visual Studio? There are a few of these on my machine.
Upvotes: 3
Views: 7271
Reputation: 41753
Inside VS in menu Tools > Command Line select Developer Command Prompt then run where cl
. You can also select Developer PowerShell and run Get-Command cl
, gcm cl
or specifically (Get-Command cl).Source
You can also open start menu, type developer and open the desired terminal
Upvotes: 6
Reputation: 2204
With the newer version, it probably lies in C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.26.28801\bin\Hostx64\x64
or C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.26.28801\bin\Hostx86\x86
(for 32-bit). 14.26.28801
will be different in your PC though
Upvotes: 0