You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
FindWDK will search for the installed Windows Development Kit (WDK) and expose commands for creating kernel drivers and kernel libraries. Also the following variables will be defined:
29
+
-`WDK_FOUND` -- if false, do not try to use WDK
30
+
-`WDK_ROOT` -- where WDK is installed
31
+
-`WDK_VERSION` -- the version of the selected WDK
32
+
-`WDK_WINVER` -- the WINVER used for kernel drivers and libraries (default value is `0x0601` and can be changed per target or globally)
33
+
34
+
## Kernel driver
35
+
The following command adds a kernel driver target called `<name>` to be built from the source files listed in the command invocation:
36
+
37
+
```cmake
38
+
wdk_add_driver(<name>
39
+
[EXCLUDE_FROM_ALL]
40
+
[KMDF <kmdf_version>]
41
+
[WINVER <winver_version>]
42
+
source1 [source2 ...]
43
+
)
44
+
```
45
+
46
+
Options:
47
+
-`EXCLUDE_FROM_ALL` -- exclude from the default build target
48
+
-`KMDF <kmdf_version>` -- use KMDF and set KMDF version
49
+
-`WINVER <winver_version>` -- use specific WINVER version
50
+
51
+
Example:
52
+
53
+
```cmake
54
+
wdk_add_driver(KmdfCppDriver
55
+
KMDF 1.15
56
+
WINVER 0x0602
57
+
Main.cpp
58
+
)
59
+
```
60
+
61
+
## Kernel library
62
+
The following command adds a kernel library target called `<name>` to be built from the source files listed in the command invocation:
63
+
64
+
```cmake
65
+
wdk_add_library(<name> [STATIC | SHARED]
66
+
[EXCLUDE_FROM_ALL]
67
+
[KMDF <kmdf_version>]
68
+
[WINVER <winver_version>]
69
+
source1 [source2 ...]
70
+
)
71
+
```
72
+
73
+
Options:
74
+
-`EXCLUDE_FROM_ALL` -- exclude from the default build target
75
+
-`KMDF <kmdf_version>` -- use KMDF and set KMDF version
76
+
-`WINVER <winver_version>` -- use specific WINVER version
77
+
-`STATIC or SHARED` -- specify the type of library to be created
78
+
79
+
Example:
80
+
81
+
```cmake
82
+
wdk_add_library(KmdfCppLib STATIC
83
+
KMDF 1.15
84
+
WINVER 0x0602
85
+
KmdfCppLib.h
86
+
KmdfCppLib.cpp
87
+
)
88
+
```
89
+
90
+
# Samples
91
+
Take a look at the [samples](samples) folder to see how WMD and KMDF drivers and libraries are built.
92
+
93
+
# License
94
+
FindWDK is licensed under the OSI-approved 3-clause BSD license. You can freely use it in your commercial or opensource software.
0 commit comments