Skip to content

Commit

Permalink
don't check for existence of latest ddk file until after find_package…
Browse files Browse the repository at this point in the history
…_handle_standard_args does its thing
  • Loading branch information
John Tyner committed Mar 26, 2018
1 parent cfd05a4 commit 74a503d
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions cmake/FindWdk.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,17 @@ file(GLOB WDK_NTDDK_FILES
"C:/Program Files*/Windows Kits/10/Include/*/km/ntddk.h"
)

if(NOT WDK_NTDDK_FILES)
return()
if(WDK_NTDDK_FILES)
list(GET WDK_NTDDK_FILES -1 WDK_LATEST_NTDDK_FILE)
endif()

list(GET WDK_NTDDK_FILES -1 WDK_LATEST_NTDDK_FILE)

include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(WDK REQUIRED_VARS WDK_LATEST_NTDDK_FILE)

if (NOT WDK_LATEST_NTDDK_FILE)
return()
endif()

get_filename_component(WDK_ROOT ${WDK_LATEST_NTDDK_FILE} DIRECTORY)
get_filename_component(WDK_ROOT ${WDK_ROOT} DIRECTORY)
get_filename_component(WDK_VERSION ${WDK_ROOT} NAME)
Expand Down

0 comments on commit 74a503d

Please sign in to comment.