Skip to content

command 'cmake.build' not found #157

Closed
@jayphelps

Description

@jayphelps

With a fresh install of vscode + cmaketools, if I try to run any of the commands I just get an error that the command is not found. e.g. command 'cmake.build' not found. None of the options show up in the toolbar, as well. Tried in 6 different cmake based projects I have on my box, same results.

Someone else posted the same issue on SO: https://stackoverflow.com/questions/44122346/vs-code-cmake-cmake-build-not-found but since it hasn't (yet) received a response I figured I'd cross post it here for more eyes. If you know the answer, you could add it to the SO question and then we can copy/link the answer here. 🎈

It's possible probable that we're just missing something obvious. If that's the case, happy to update the README so others don't make it too.

(from README)

PLEASE, if you experience any problems, have any questions, or have an idea for a new feature, create an issue


EDIT:

Solution

there's a bug preventing a dependency from being installed. You need to install this additional extension https://marketplace.visualstudio.com/items?itemName=twxs.cmake

Activity

wtianyi

wtianyi commented on Jun 3, 2017

@wtianyi

Did you install the extension twxs.cmake? It's a required dependency but was not installed when I installed cmaketools. Installing that solves my similar problem.

vector-of-bool

vector-of-bool commented on Jun 4, 2017

@vector-of-bool
Contributor

@jayphelps, as @wtianyi said, does installing the twxs.cmake extension help?

I have it listed in package.json as an extension dependency, and I thought that VSCode would use that to automatically install other extensions, but apparently not.

added this to the 0.10.0 milestone on Jun 4, 2017
jayphelps

jayphelps commented on Jun 5, 2017

@jayphelps
Author

Yes, installing twxs.cmake (also known as just "CMake" in the marketplace) solved it for me. Here's a direct link to the correct one for anyone looking: https://marketplace.visualstudio.com/items?itemName=twxs.cmake

Feel free to close when you believe you've solved the issue preventing it from being installed automatically.

Thanks for your help!

kriegalex

kriegalex commented on Jun 5, 2017

@kriegalex

I do have the same problem as @jayphelps but I already had Cmake (from twxs) installed

papahabla

papahabla commented on Jun 5, 2017

@papahabla

I needed to uninstall both CMake, and CMake Tools extensions. After re-installing them, everything worked again.

vector-of-bool

vector-of-bool commented on Jun 6, 2017

@vector-of-bool
Contributor

@kriegalex, are you still seeing this problem? Did this first start after the 0.9.5 update?

benkonz

benkonz commented on Jun 6, 2017

@benkonz

@vector-of-bool I just started getting this issue today also.

vector-of-bool

vector-of-bool commented on Jun 6, 2017

@vector-of-bool
Contributor

The same error appears in issue #163, but it may be a different issue. Check over there if the listed solution above doesn't work for you.

kriegalex

kriegalex commented on Jun 6, 2017

@kriegalex

I just tried to uninstall, restart and reinstall, still having this problem. I don't know when it started because I have this problem since day one, but I only tried VS Code + CMake recently. I am working with Visual Studio 2015 and CMake 3.8 aside, that's why I didn't really go further.

This is the output of the Developer Tools :

[Extension Host] Error setting up client: AssertionError: Unknown cache entry type: undefined
    at Console.assert (console.js:95:23)
    at Function.parseCache (C:\Users\kriegalex\.vscode\extensions\vector-of-bool.cmake-tools-0.9.6\out\src\cache.js:116:29)
    at Function.<anonymous> (C:\Users\kriegalex\.vscode\extensions\vector-of-bool.cmake-tools-0.9.6\out\src\cache.js:65:50)
    at Generator.next (<anonymous>)
    at fulfilled (C:\Users\kriegalex\.vscode\extensions\vector-of-bool.cmake-tools-0.9.6\out\src\cache.js:4:58)
[Extension Host] Error during CMake Tools initialization! TypeError: Cannot read property 'getGlobalSettings' of undefined
    at ServerClientCMakeTools.<anonymous> (C:\Users\kriegalex\.vscode\extensions\vector-of-bool.cmake-tools-0.9.6\out\src\client.js:328:44)
    at Generator.next (<anonymous>)
    at fulfilled (C:\Users\kriegalex\.vscode\extensions\vector-of-bool.cmake-tools-0.9.6\out\src\client.js:4:58)

The second error can be removed by disabling CMake server (cmake.useCMakeServer=false).

benkonz

benkonz commented on Jun 6, 2017

@benkonz

@vector-of-bool I set cmake.useCmakeServer to false just like the fix in #163 and it worked, thanks.

jessehao

jessehao commented on Jun 7, 2017

@jessehao

I had the same problem. few days ago, I installed this extension on my PC and everything worked well. but yesterday, I installed it to my Laptop(Windows), the problem occured. and I tried everything like uninstall them and reinstall them one by one. but it's not working.
Everything sets just like my PC's except the result.

if i turn cmake.useCMakeServer to false. it'll working, but it build project to "vscproject" instead of "MinGW Makefiles".

jessehao

jessehao commented on Jun 7, 2017

@jessehao

OK guys, problem solved!
Platform: Windows + MinGW
Solution:

  1. create a new copy of "mingw32-make.exe".
  2. rename the copy to "make.exe".
  3. restart your vscode.
ytimenkov

ytimenkov commented on Jun 7, 2017

@ytimenkov
Contributor

I just checked: since vector-of-bool.cmake-tools depends on twxs.cmake extension, VS code automatically install the latter and doesn't allow to disable or uninstall it separately.
At least version 1.12 I'm using.

vector-of-bool

vector-of-bool commented on Jun 8, 2017

@vector-of-bool
Contributor

So, I've just pushed 0.9.7:

  1. No more dependency on twxs.cmake, so that shouldn't be causing any issues anymore
  2. @ytimenkov fixed some version parsing code that was lying about what version of CMake was installed. Should fix issues people are seeing with pre-3.7 versions.
  3. @ytimenkov added better errors when initialization failed. This should help create future tickets!

As such, I'm going to close this issue and ask that anyone with any further issues open a new ticket using the new error messages that appear during a failed initialization.

Thanks for the help, everyone!

locked and limited conversation to collaborators on Jan 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    buga bug in the product

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @jayphelps@kriegalex@wtianyi@jessehao@ytimenkov

        Issue actions

          command 'cmake.build' not found · Issue #157 · microsoft/vscode-cmake-tools