Skip to content

Instantly share code, notes, and snippets.

@navono
Created July 7, 2021 07:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save navono/d8c86fe25e62428f2045cf8683695b93 to your computer and use it in GitHub Desktop.
Save navono/d8c86fe25e62428f2045cf8683695b93 to your computer and use it in GitHub Desktop.
CMake include Windows SDK path
include(FindWindowsSDK)
if (NOT WINDOWSSDK_FOUND)
message("Windows SDK not found")
endif()
get_windowssdk_include_dirs(${WINDOWSSDK_LATEST_DIR} WINDOWSSDK_INCLUDE_DIRS)
# message(${WINDOWSSDK_INCLUDE_DIRS})
target_include_directories(${TARGET} INTERFACE ${WINDOWSSDK_INCLUDE_DIRS})
set_target_properties(${TARGET} PROPERTIES LINK_FLAGS "/SUBSYSTEM:CONSOLE /SAFESEH:NO")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment