MinGW sh.exe must NOT be in your path

試著忘記壹切 提交于 2019-12-02 17:28:52

For me, this simple parameter passed to cmake has worked -DCMAKE_SH="CMAKE_SH-NOTFOUND".

Check you really do not have sh.exe in your PATH by opening a Windows Command Line and typing where sh.exe. If you have this file in your path, the command will return its path (then you should remove it from your PATH) else if windows return it was not found, try to clean up the folder CMakeFiles and a file name CMakeCache.txt somewhere inside your project folder.

If you have install git, just add gitPath/bin to your User or System environment variable PATH.

For example, I add C:\Program Files\Git\bin to my User PATH environment variable.

It's the problem of your git's path.
I assume you are using the Clion, just check if you have added %gitpath%\binto your path, that's where the problem is. You should use %gitpath%\cmdinstead, typically for me it's D:\Git\cmd.Since the former one includes sh.exe in your path which results in the error.

Just add

set(DCMAKE_SH="CMAKE_SH-NOTFOUND")

to your

CMakeLists.txt file

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!