CMake not found but is part of Visual Studio installation. Could automatically check #610
Labels
enhancement
an enhancement to the product that is either not present or an improvement to an existing feature
Feature: configure
Milestone
I start by saying that I don't know TypeScript but can follow somehow code.
In a Windows system, CMake can be installed as part of Visual Studio and not necessarily as a separate standalone program downloaded from the CMake website.
For example, in my case, I have Windows 10 and Visual Studio Community 2017 version 15.9.4 .
I installed CMake from within Visual Studio because it is part of one of the workload component.
In such a situation (my case), CMake and the related tools, get installed in the following path
C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin
in which one finds: cmake.exe, cpack.exe, ctest.exe and cmcldeps.exe .
So in this case there is a CMake in the system, but it's not found by vscode-cmake-tools because it's neither in the
PATH
or in one of the two hard-coded guesseshttps://github.com/vector-of-bool/vscode-cmake-tools/blob/358d8dc533168b94ecec73c32af81659e3c82975/src/paths.ts#L137
I was thinking that maybe one could add a field to
https://github.com/vector-of-bool/vscode-cmake-tools/blob/358d8dc533168b94ecec73c32af81659e3c82975/src/kit.ts#L342
like
hasCMake
and then check for the existence by building the path similarly tohttps://github.com/vector-of-bool/vscode-cmake-tools/blob/358d8dc533168b94ecec73c32af81659e3c82975/src/kit.ts#L501
having something like this:
const hasCMakeVSBuiltin = fs.exists(path.join(inst.installationPath, 'Common7', 'IDE', 'CommonExtensions', 'Microsoft', 'CMake', 'CMake', 'bin', 'cmake.exe')) ;
and set to true or false accordingly the
hasCmake
field.Then for example one could add this candidate to
https://github.com/vector-of-bool/vscode-cmake-tools/blob/358d8dc533168b94ecec73c32af81659e3c82975/src/paths.ts#L137
or similar.
By automatically finding CMake among the extensions by checking that path for VS installation then I think it would ease the setup and avoid some manual tuning (I know, it's minor if you know where CMake was installed as part of VS).
Sure one can write that path in the settings.json, that is what I did.
The text was updated successfully, but these errors were encountered: