[PATCH v2 02/10] cmake: do find Git for Windows' shell interpreter
- From
Johannes Schindelin via GitGitGadget <gitgitgadget@gmail.com>
- Date
- Sep 26, 2020, 21:32 UTC
- Message-ID
- <05b4b69fee2b8c32769dd72dea182cfb72a14876.1601155970.git.gitgitgadget@gmail.com>
- In-Reply-To
- <pull.738.v2.git.1601155970.gitgitgadget@gmail.com>
From: Johannes Schindelin <johannes.schindelin@gmx.de>
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 <johannes.schindelin@gmx.de> --- 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