@matheusbsbs / matheus-bagliano / commits / f2f1250c47
Fork 0

cmake (Windows): recommend using Visual Studio's built-in CMake support

It is a lot more convenient to use than having to specify the configuration in CMake manually (does not matter whether using the command-line or CMake's GUI). While at it, recommend using `contrib/buildsystems/out/` as build directory also in the part that talks about running CMake manually. Helped-by: Junio C Hamano <gitster@pobox.com> Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Johannes Schindelin committed Sep 30, 2020 at 15:26 UTC f2f1250c47fd967b7678cad329438e8deac62038
1 file changed +17 -9
contrib/buildsystems/CMakeLists.txt
+17 -9
@@ -4,17 +4,25 @@
4
5 #[[
6
7 -Instructions to run CMake:
7 +Instructions how to use this in Visual Studio:
8
9 -cmake `relative-path-to-CMakeLists.txt` -DCMAKE_BUILD_TYPE=Release
10 -Eg.
11 -From the root of git source tree
12 - `cmake contrib/buildsystems/ `
13 -This will build the git binaries at the root
9 +Open the worktree as a folder. Visual Studio 2019 and later will detect
10 +the CMake configuration automatically and set everything up for you,
11 +ready to build. You can then run the tests in `t/` via a regular Git Bash.
12
15 -For out of source builds, say build in 'git/git-build/'
16 - `mkdir git-build;cd git-build; cmake ../contrib/buildsystems/`
17 -This will build the git binaries in git-build directory
13 +Note: Visual Studio also has the option of opening `CMakeLists.txt`
14 +directly; Using this option, Visual Studio will not find the source code,
15 +though, therefore the `File>Open>Folder...` option is preferred.
16 +
17 +Instructions to run CMake manually:
18 +
19 + mkdir -p contrib/buildsystems/out
20 + cd contrib/buildsystems/out
21 + cmake ../ -DCMAKE_BUILD_TYPE=Release
22 +
23 +This will build the git binaries in contrib/buildsystems/out
24 +directory (our top-level .gitignore file knows to ignore contents of
25 +this directory).
26
27 Possible build configurations(-DCMAKE_BUILD_TYPE) with corresponding
28 compiler flags