Why I cannot see CMake version from the terminal inside Visual Studio Code?

Viewed 1010

I installed CMake on Windows and I added the path to Sytem Variables (C:\Program Files\CMake\bin)

I can see it with from command prompt:

D:\>cmake --version
cmake version 3.18.2
CMake suite maintained and supported by Kitware (kitware.com/cmake).

But when I try to same from the Visual Studio Code's terminal, I get an error:

PS D:\Cmake\Mastering-CMake> cmake --version
cmake : The term 'cmake' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path 
is correct and try again.
At line:1 char:1
+ cmake --version
+ ~~~~~
    + CategoryInfo          : ObjectNotFound: (cmake:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

The CMake extension also reports an error:

The "cmake" command is not found in PATH.  Install it or use `cmake.cmakePath` in the workspace settings to define the CMake executable binary.

But I already added CMake to the Path. What else should I do? Thanks!

1 Answers

Restarting Visual Studio Code made it update the PATH. New terminals can find cmake now.

Related