[CMake] MinGW Error having sh.exe

J Decker d3ck0r at gmail.com
Thu Feb 4 12:03:28 EST 2016


When using -G "MinGW Makefiles" I keep getting an error

---------------------------

CMake Error at C:/General/tools/unix/cmake/share/cmake-3.5/Modules/CMakeMinGWFindMake.cmake:22
(message):
  sh.exe was found in your PATH, here:

  C:/Program Files/Git/bin/sh.exe

  For MinGW make to work correctly sh.exe must NOT be in your path.

  Run cmake from a shell that does not have sh.exe in your PATH.

  If you want to use a UNIX shell, then use MSYS Makefiles.

Call Stack (most recent call first):
  CMakeLists.txt:8 (project)


CMake Error: CMAKE_C_COMPILER not set, after EnableLanguage
CMake Error: CMAKE_CXX_COMPILER not set, after EnableLanguage
-- Configuring incomplete, errors occurred!

-------------------------

if I just re-run the cmake It completes fine and even compiles correctly.

It's getting sh because GIT uses it... and it's not something I can
really bypass, and I sometimes do NEED git in my path.

if I just edit the CmakeMinGWFIndMake.cmake file and comment out the
mesage box and make program override it also works just fine.

once upon a time ... maybe a decade ago sh.exe in the path caused
erorrs... but this sin't such an issue anymore. ( Since Mingw32-make
ignores -j # option?)

---------
if(CMAKE_SH)

  #message(FATAL_ERROR "sh.exe was found in your PATH,
here:\n${CMAKE_SH}\nFor MinGW make to work correctly sh.exe must NOT
be in your path.\nRun cmake from a shell that does not have sh.exe in
your PATH.\nIf you want to use a UNIX shell, then use MSYS
Makefiles.\n")

  #set(CMAKE_MAKE_PROGRAM NOTFOUND)

endif()
-------------


More information about the CMake mailing list