cmake (Windows): initialize vcpkg/build dependencies automatically
authorJohannes Schindelin <johannes.schindelin@gmx.de>
Wed, 30 Sep 2020 15:26:22 +0000 (15:26 +0000)
committerJunio C Hamano <gitster@pobox.com>
Wed, 30 Sep 2020 20:26:36 +0000 (13:26 -0700)
commitb490283d5200952b87f49ac43457da7a332b4598
tree35773657fa65d6d474ec7c5e23c70da5d9cc197a
parent2d9eb4ed2cd8a0105c65167fdc9ddb0ddcde42c5
cmake (Windows): initialize vcpkg/build dependencies automatically

The idea of having CMake support in Git's source tree is to enable
contributors on Windows to start contributing with little effort. To
that end, we just added some sensible defaults that will let users open
the worktree in Visual Studio and start building.

This expects the dependencies (such as zlib) to be available already,
though. If they are not available, we expect the user to run
`compat/vcbuild/vcpkg_install.bat`.

Rather than requiring this step to be manual, detect the situation and
run it as part of the CMake configuration step.

Note that this obviously only applies to the scenario when we want to
compile in Visual Studio (i.e. with MS Visual C), not with GCC.
Therefore, we guard this new code block behind the `MSVC` conditional.

This concludes our journey to make it as effortless as possible to start
developing Git in Visual Studio: all the developer needs to do is to
clone Git's repository, open the worktree via `File>Open>Folder...` and
wait for CMake to finish configuring.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
contrib/buildsystems/CMakeLists.txt