FindGit doesn't work outside of MSVC
I'm trying to use CMake outside of MSVC. It is still using the MSVC generator, it's just that CMake isn't being executed inside the MSVC command prompt, it is being executed in PowerShell. In this case, the use of NO_SYSTEM_ENVIRONMENT_PATH
in FindGit.cmake
results in no possible search paths and Git is not found. However, removing that finds git in the normal install location which is C:\Program Files\Git\bin
. Unfortunately, FindGit.cmake
states the following:
# Now look for installations in Git/ directories under typical installation
# prefixes on Windows. Exclude PATH from this search because VS 2017's
# command prompt happens to have a PATH entry with a Git/ subdirectory
# containing a minimal git not meant for general use.
I don't know if this is still the case for MSVC 2019, which I use, but this workaround for a bad decision in MSVC 2017 is preventing FindGit.cmake
from working as it should in the general environment.