I am a maintainer of a library (OpenXLSX) and have recently augmented the CMake configuration to auto-pull dependencies via find_package or FetchContent from their source repositories, instead of including a copy of the dependencies with our own library.
I have been asking one of our Windows users to test a new configuration for me, and it seems to be non-trivial to get git working for FetchContent.
On their configuration, CMake complains about not finding git.
As this is a generic “getting started” problem:
Is there a comprehensive guide on installing CMake on Windows so that integration with git is working & commands like FetchContent can be used?
I have no access to a Windows test system, so I can’t trial & error a solution for this.
Any help is appreciated so I can instruct our users on how to prepare their CMake for building OpenXLSX.
With you phrasing this as an “or” question - are you saying that CMake on Windows runs without MinGW?
My question, reduced to the simplest form is:
“How do Windows users install CMake so that it can build projects whose CMake configuration invokes FetchContent commands?”
with the implication being that - as per the observed errors - FetchContent uses git in the background, and CMake in the install that my user reported a test from, does not “find” git.
Your last bullet list sounds like what I am looking for, and reasonably to the point.
Regarding your prior comment: I don’t understand the question about the build system - it’s CMake, hence me posting here The target system for Windows users is the system on which the build is taking place, i.e. also Windows.
For the toolchain: I would assume both work, gcc/g++ or MSVC, but I have no experience with MSVC (nor do I intend to ever touch it), so let’s focus on g++ for starters.
I will see if one of our users can test the installation sequence you proposed:
install MSYS2
via MSYS2, install
mingw-w64-x86_64-cmake
mingw-w64-x86_64-toolchain
git
run cmake from the mingw64 shell (without ninja, which I assume you wrote as an example)