Skip to content

Instantly share code, notes, and snippets.

@S0PEX
Created March 16, 2022 20:45
Show Gist options
  • Save S0PEX/fd62dfa13a404f1028cb719bb7f199c1 to your computer and use it in GitHub Desktop.
Save S0PEX/fd62dfa13a404f1028cb719bb7f199c1 to your computer and use it in GitHub Desktop.
CMake Driver CMakeLists.txt Example
# Setup WDK, make sure to edit the path variable as my Finddk.cmake is at
# - root
# -- cmake
# ---- FindWdk.cmake
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/cmake")
find_package(WDK REQUIRED)
# Set include from include and src
include_directories(
${CMAKE_CURRENT_SOURCE_DIR}/include
${CMAKE_CURRENT_SOURCE_DIR}/src
)
# Add source to this project's executable.
wdk_add_driver(Driver
KMDF 1.15
WINVER 0x0A000000 # Windows 10 1507 "Threshold"
CUSTOM_ENTRY_POINT "DriverEntry"
"src/Driver.cpp"
)
# Link 3rd party libs
find_package(WIL CONFIG REQUIRED)
target_link_libraries(Driver WIL::WIL)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment