I’m utilizing CMake to build Windows kernel drivers, but currently I have to drop a WindowsKernel.cmake into the Modules/Platforms dir to make it work. Could the following be added to CMake to support his natively?
To answer this: I may be wrong, but as you said CMake does not have any inbuilt registration for WDK like it does the SDK. Extrapolate this, ignoring my toolchain spec to make this work, to how CMake handles platform types. Unless you explicitly add a WindowsKernel.cmake file to Modules/Platform there is no way to specify a platform target. This will result in what ultimately led me here:
System is unknown to cmake, create:
Platform/WindowsKernel to use this system, please post your config file on discourse.cmake.org so it can be added to cmake
I’ve been manually patching WindowsKernel.cmake into Modules/Platform but this is cumbersome as we have multiple users and it often gets forgotten.
Alternatively, is there any way to specify platform systems outside of CMake? I tried multiple approaches, but it seems CMake is hardcoded to only consider Modules/Platform.
Sorry @ben.boeckel I wasn’t sure where to post this.
Thanks for posting the UMDF discussion. This would effectively be covered by adding inc/wdf/kmdf and inc/wdf/umdf to the include_directories and lib/wdf/kmdf/amd64/1.9 to the link_directories in my example above, or alternatively using the i386/ia64 targets if a non-amd64 target is desired.
The FindWDK.cmake from that discussion is relevant as well, it handles UMDF includes if WDK_KMDF is defined in a similar fashion to what I described above. I’m specifically using WDK 7.1 for legacy OS coverage, there have been changes to the directory layout of newer WDKs.