CMake building for MinGW issue with Git sh.exe

Jørgen Ibsen's Avatar

Jørgen Ibsen

01 Oct, 2015 11:54 PM


I am trying to set up a config that uses CMake to build both using MSVC and MinGW, but it appears CMake has an issue with the installed Git putting sh.exe in PATH, when run with -G "MinGW Makefiles".


sh.exe was found in your PATH, here:
C:/Program Files (x86)/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.
  1. Support Staff 1 Posted by Feodor Fitsner on 02 Oct, 2015 02:14 AM

    Feodor Fitsner's Avatar

    You can modify PATH variable and remove sh.exe from it.

  2. 2 Posted by Jørgen Ibsen on 02 Oct, 2015 08:04 AM

    Jørgen Ibsen's Avatar

    Thank you for the reply.

    I managed to get it to work with set PATH=%PATH:C:\Program Files (x86)\Git\bin;=%.

  3. Support Staff 3 Posted by Feodor Fitsner on 02 Oct, 2015 02:38 PM

    Feodor Fitsner's Avatar

    Cool, thanks for the update!

    Would you mind if I make this thread public to share the solution with others?

  4. 4 Posted by Jørgen Ibsen on 02 Oct, 2015 03:27 PM

    Jørgen Ibsen's Avatar

    Sure, in case it is of use to anyone, here is a link to the appveyor.yml I ended up with.

    It uses your environment variable matrix to run CMake with different generators, so it can test both MinGW, and 32- and 64-bit MSVC without much scripting.

  5. Support Staff 5 Posted by Feodor Fitsner on 02 Oct, 2015 04:46 PM

    Feodor Fitsner's Avatar

    Great, thanks!

  6. Ilya Finkelshteyn closed this discussion on 25 Aug, 2018 02:00 AM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts


? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac