Skip to content

Commit d958106

Browse files
committed
README.windows.md: Add VS 2022. [skip ci]
Also, put the "here's how to install CMake from Visual Studio" stuff ahead of the "oh, and you can install it with Chocolatey" stuff.
1 parent 09454b9 commit d958106

File tree

1 file changed

+42
-10
lines changed

1 file changed

+42
-10
lines changed

doc/README.windows.md

Lines changed: 42 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -82,21 +82,22 @@ downloaded from [here](https://cmake.org/download/).
8282
When you run the installer, you should choose to add CMake to the system
8383
`PATH` for all users and to create the desktop icon.
8484

85+
Visual Studio 2017, 2019, and 2022 provide CMake, so you will not need
86+
to install CMake if you have installed one of those versions of Visual
87+
Studio. They include built-in support for CMake-based projects as
88+
described
89+
[here](https://devblogs.microsoft.com/cppblog/cmake-support-in-visual-studio/).
90+
91+
For Visual Studio 2017, make sure "Visual C++ tools for CMake" is
92+
installed; for Visual Studio 2019 and 2022, make sure "C++ CMake tools
93+
for Windows" is installed.
94+
8595
CMake can also be installed as the Chocolatey package `cmake`:
8696

8797
```
8898
choco install -y cmake
8999
```
90100

91-
Visual Studio 2017 and later provide CMake, so you will not need to
92-
install CMake if you have installed Visual Studio 2017 or later. They
93-
include built-in support for CMake-based projects as described
94-
[here](https://devblogs.microsoft.com/cppblog/cmake-support-in-visual-studio/).
95-
96-
For Visual Studio 2017, make sure "Visual C++ tools for CMake" is
97-
installed; for Visual Studio 2019, make sure "C++ CMake tools for
98-
Windows" is installed.
99-
100101
Git
101102
---
102103

@@ -135,7 +136,7 @@ with Control-S.
135136
Visual Studio will then re-run CMake. If that completes without errors,
136137
you can build with CMake > "Build All".
137138

138-
### Visual Studio 2019 ###
139+
### Visual Studio 2019 and 2022 ###
139140

140141
Open the folder containing the libpcap source with Open > Folder.
141142
Visual Studio will run CMake; however, you will need to indicate where
@@ -223,6 +224,37 @@ msbuild /m /nologo /p:Configuration={configuration} tcpdump.sln
223224

224225
where `{configuration}` can be "Release", "Debug", or "RelWithDebInfo".
225226

227+
### Visual Studio 2022 ###
228+
229+
Start the appropriate Native Tools command line prompt.
230+
231+
Change to the directory into which you want to build tcpdump, possibly
232+
after creating it first. One choice is to create it as a subdirectory
233+
of the tcpdump source directory.
234+
235+
Run the command
236+
237+
```
238+
cmake "-DPCAP_ROOT={path-to-sdk}" -G "Visual Studio 17 2022" {platform} {path-to-tcpdump-source}
239+
```
240+
241+
`{path-to-sdk}` is the path of the directory containing the Npcap or
242+
WinPcap SDK.
243+
244+
`{platform}` is `-A Win32` to build a 32-bit version of tcpdump or `-A
245+
x64` to build a 64-bit version of tcpdump.
246+
247+
`{path-to-tcpdump-source}` is the pathname of the top-level source
248+
directory for tcpdump.
249+
250+
Run the command
251+
252+
```
253+
msbuild /m /nologo /p:Configuration={configuration} tcpdump.sln
254+
```
255+
256+
where `{configuration}` can be "Release", "Debug", or "RelWithDebInfo".
257+
226258
Building with MinGW
227259
-------------------
228260

0 commit comments

Comments
 (0)