Skip to content

Commit f2f1250

Browse files
dschogitster
authored andcommitted
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 <[email protected]> Signed-off-by: Johannes Schindelin <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent b490283 commit f2f1250

File tree

1 file changed

+17
-9
lines changed

1 file changed

+17
-9
lines changed

contrib/buildsystems/CMakeLists.txt

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,25 @@
44

55
#[[
66
7-
Instructions to run CMake:
7+
Instructions how to use this in Visual Studio:
88
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.
1412
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).
1826
1927
Possible build configurations(-DCMAKE_BUILD_TYPE) with corresponding
2028
compiler flags

0 commit comments

Comments
 (0)