0
mkdir build
cd build
cmake -G "MinGW Makefiles" ..
CMake Error at I:/msys64/mingw32/share/cmake-3.13/Modules/CMakeMinGWFindMake.cmake:12 (message):
  sh.exe was found in your PATH, here:

  I:/msys64/usr/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:16 (PROJECT)


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

but it would appear the the offending sh.exe is part of msys??

OK so try the msys shell... i:\msys64\mingw32

rm -rf build
mkdir build
cd build
cmake -G "MinGW Makefiles" ..
CMake Error at I:/msys64/mingw32/share/cmake-3.13/Modules/CMakeMinGWFindMake.cmake:12 (message):
  sh.exe was found in your PATH, here:

  I:/msys64/usr/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:16 (PROJECT)


CMake Error: CMake was unable to find a build program corresponding to "MinGW Makefiles".  CMAKE_MAKE_PROGRAM is not set.  You probably need to select a different build tool.
CMake Error: CMake was unable to find a build program corresponding to "MinGW Makefiles".  CMAKE_MAKE_PROGRAM is not set.  You probably need to select a different build tool.
CMake Error: CMAKE_C_COMPILER not set, after EnableLanguage
CMake Error: CMAKE_CXX_COMPILER not set, after EnableLanguage
-- Configuring incomplete, errors occurred!

same thing.

should sh.exe not be there?

one last try...

cmake -G "MinGW Makefiles" -DCMAKE_SH="CMAKE_SH-NOTFOUND" ..

$ cmake -G "MinGW Makefiles" -DCMAKE_SH="CMAKE_SH-NOTFOUND" ..
CMake Error: CMake was unable to find a build program corresponding to "MinGW Makefiles".  CMAKE_MAKE_PROGRAM is not set.  You probably need to select a different build tool.
CMake Error: CMake was unable to find a build program corresponding to "MinGW Makefiles".  CMAKE_MAKE_PROGRAM is not set.  You probably need to select a different build tool.
CMake Error: CMAKE_C_COMPILER not set, after EnableLanguage
CMake Error: CMAKE_CXX_COMPILER not set, after EnableLanguage
-- Configuring incomplete, errors occurred!

So it would seem there's a second problem as well?

any help? thanks.

jkj yuio
  • 2,543
  • 5
  • 32
  • 49
  • Like the error message says, if you're running under an MSYS shell, you should use `cmake -G "MSYS Makefiles" ...` **not** `cmake -G "MinGW Makefiles" ...` – nega Mar 11 '19 at 20:18

1 Answers1

1

First of all, make sure you have mingw32-make installed:

which mingw32-make

if not /mingw64/bin/mingw32-make then either the path is not in your ~/.bashrc or it is not installed. I think you can install it by

pacman -S mingw64/mingw-w64-x86_64-make

which is also part of mingw-w64-x86_64-toolchain that you have probably already installed. then you should be able to run

cmake -D CMAKE_MAKE_PROGRAM:PATH=/mingw64/bin/mingw32-make

please give it a try and let me know if this works for you.

Foad S. Farimani
  • 12,396
  • 15
  • 78
  • 193