Hadi GhahremanNezhad
Hadi GhahremanNezhad

Reputation: 2445

The term 'cmake' is not recognized as the name of a cmdlet

I am trying to use CMake in the command line on Windows 10. This used to work before, but I don't know why it doesn't work anymore. I installed new version of CMake and added the path to the Environment Variables. However, when trying to use it in Powershell like this: cmake -G "Visual Studio 14 2015 Win64" ..

it shows this error:

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

This is my Environment Variables:

enter image description here

I have added C:\Program Files\CMake\bin to the end of the path variable. I have also tried uninstall and reinstalling CMake, but didn't help.

Upvotes: 7

Views: 23409

Answers (1)

wasif
wasif

Reputation: 15478

In current powershell session, you have to add the path to path environment variable. You have to use this:

$env:path += ";C:\Program Files\cmake\bin"
cmake -g ...

Upvotes: 6

Related Questions