From: Johannes Schindelin <redacted>
By default, Git for Windows does not install its `sh.exe` into the
`PATH`. However, our current `CMakeLists.txt` expects to find a shell
interpreter in the `PATH`.
So let's fall back to looking in the default location where Git for
Windows _does_ install a relatively convenient `sh.exe`:
`C:\Program Files\Git\bin\sh.exe`
Signed-off-by: Johannes Schindelin <redacted>
---
contrib/buildsystems/CMakeLists.txt | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/contrib/buildsystems/CMakeLists.txt b/contrib/buildsystems/CMakeLists.txt
index 5007f173f1..d14fa4f3dc 100644
--- a/contrib/buildsystems/CMakeLists.txt
+++ b/contrib/buildsystems/CMakeLists.txt
@@ -43,8 +43,11 @@ set(CMAKE_SOURCE_DIR ${CMAKE_CURRENT_LIST_DIR}/../..)
find_program(SH_EXE sh)
if(NOT SH_EXE)
- message(FATAL_ERROR "sh: shell interpreter was not found in your path, please install one."
- "On Windows, you can get it as part of 'Git for Windows' install at https://gitforwindows.org/")
+ set(SH_EXE "C:/Program Files/Git/bin/sh.exe")
+ if(NOT EXISTS ${SH_EXE})
+ message(FATAL_ERROR "sh: shell interpreter was not found in your path, please install one."
+ "On Windows, you can get it as part of 'Git for Windows' install at https://gitforwindows.org/")
+ endif()
endif()
#Create GIT-VERSION-FILE using GIT-VERSION-GEN--
gitgitgadget