我正在尝试在Windows 10的命令行中使用CMake。以前可以使用,但我不知道为什么现在不能用了。我安装了新版本的CMake并将路径添加到环境变量中。然而,在尝试像这样在Powershell中使用它时:
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 -G "Visual Studio 14 2015 Win64" ..
它显示以下错误: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
这是我的环境变量: 我已将
C:\Program Files\CMake\bin
添加到 path
变量的末尾。我也尝试卸载和重新安装 CMake,但没有帮助。
$env:Path -split ';'
命令查看会话中该值。 - Lee_DaileyC:\Program Files\CMake\bin
不在powershell路径中。 - Hadi GhahremanNezhadEnvironment.SetEnvironmentVariable Method (System) | Microsoft Docs — https://learn.microsoft.com/en-us/dotnet/api/system.environment.setenvironmentvariable?view=netframework-4.8
<<< - Lee_Dailey