Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CMake not found but is part of Visual Studio installation. Could automatically check #610

Closed
fedepad opened this issue Dec 14, 2018 · 1 comment
Labels
enhancement an enhancement to the product that is either not present or an improvement to an existing feature Feature: configure fixed (release pending) fixed in pre-release and is pending official release
Milestone

Comments

@fedepad
Copy link

fedepad commented Dec 14, 2018

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 guesses
https://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 to
https://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.

@bobbrow bobbrow added enhancement an enhancement to the product that is either not present or an improvement to an existing feature Feature: configure labels Jul 20, 2019
@bobbrow bobbrow added this to the On Deck milestone Jul 20, 2019
@bobbrow bobbrow added the fixed (release pending) fixed in pre-release and is pending official release label Jan 24, 2020
@andreeis
Copy link
Contributor

andreeis commented Feb 4, 2020

Closing since this is fixed in CMake Tools Beta2. Please reactivate if you encounter any other symptoms of this issue.

@andreeis andreeis closed this as completed Feb 4, 2020
@github-actions github-actions bot locked and limited conversation to collaborators Feb 1, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement an enhancement to the product that is either not present or an improvement to an existing feature Feature: configure fixed (release pending) fixed in pre-release and is pending official release
Projects
None yet
Development

No branches or pull requests

3 participants