Skip to content

Commit

Permalink
Make FindDirectX.cmake first search specified paths, then default to …
Browse files Browse the repository at this point in the history
…PATH
  • Loading branch information
4444N committed Dec 12, 2020
1 parent ac6913a commit fcdfcd2
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions CMake/Modules/FindDirectX.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ if(WIN32)
else ()
set (ProgramFiles "$ENV{ProgramFiles}")
endif ()
# first check specified paths
find_path (DirectX_ROOT_DIR
Include/d3d9.h
PATHS
Expand All @@ -34,8 +35,17 @@ if(WIN32)
"${ProgramFiles}/Microsoft DirectX SDK (November 2007)"
"${ProgramFiles}/Microsoft DirectX SDK (August 2007)"
"${ProgramFiles}/Microsoft DirectX SDK"
NO_DEFAULT_PATH
DOC "DirectX SDK root directory"
)
# if specified paths do not contain dx then search PATH
if (NOT DirectX_ROOT_DIR)
find_path(DirectX_ROOT_DIR
Include/d3d9.h
DOC "DirectX SDK root directory"
)
endif()

if (DirectX_ROOT_DIR)
set (DIRECTX_INCLUDE_SEARCH_PATHS "${DirectX_ROOT_DIR}/Include")
set (DIRECTX_LIBRARY_SEARCH_PATHS "${DirectX_ROOT_DIR}/Lib/${DirectX_ARCHITECTURE}")
Expand Down

0 comments on commit fcdfcd2

Please sign in to comment.