SergiusTheBest / FindWDK

CMake module for building drivers with Windows Development Kit (WDK)
BSD 3-Clause "New" or "Revised" License
251 stars 53 forks source link

Set VS_PLATFORM_TOOLSET="WindowsKernelModeDriver10.0" #28

Open cpkt9762 opened 1 year ago

cpkt9762 commented 1 year ago

sets the platform toolset to "WindowsKernelModeDriver10.0"

set_property(TARGET ${_target} PROPERTY VS_PLATFORM_TOOLSET WindowsKernelModeDriver10.0)

sets the configuration type to "Driver"

set_property(TARGET ${_target} PROPERTY VS_CONFIGURATION_TYPE "Driver")

set_target_properties(${_target} 
                      PROPERTIES 
                      # Targeting Windows 10
                      VS_GLOBAL_TargetVersion "Windows10"
                      # Developing a Windows Driver Model (WDM) driver
                      VS_GLOBAL_DriverType "WDM" 
                      # Targeting Universal platform
                      VS_GLOBAL_DriverTargetPlatform "Universal" 
                      # Not using debug libraries
                      VS_GLOBAL_UseDebugLibraries "false"  
                      # Disabling API validation
                      VS_GLOBAL_ApiValidator_Enable "false"  
                      # Using local time for INF2CAT timestamping
                      VS_GLOBAL_Inf2CatUseLocalTime "true"  
                      # Turning off driver signing
                      VS_GLOBAL_SignMode "Off"  
                      # Targeting .NET Framework version 4.5
                      VS_GLOBAL_TargetFrameworkVersion "v4.5"
                      # Minimum required version of Visual Studio is 12.0 (Visual Studio 2013)
                      VS_GLOBAL_MinimumVisualStudioVersion "12.0"
                      )

if build error “GetDriverProjectAttributes” and “GetPackageFiles”

Disable the generation of ZERO_CHECK

set(CMAKE_SUPPRESS_REGENERATION true)

https://discourse.cmake.org/t/unable-to-fully-build-windows-umdf-driver-using-cmake/2368/12 https://gitlab.kitware.com/cmake/cmake/-/issues/23643 https://gitlab.kitware.com/cmake/cmake/-/issues/23717

<Project DefaultTargets="Build" ToolsVersion="17.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
    <Target Name="GetDriverProjectAttributes" Returns="@(DriverProjectAttributes)"/>
    <Target Name="GetPackageFiles" Returns="@(FullyQualifiedFilesToPackage)"/>  
</Project>