FindVulkan: Prefer VULKAN_SDK env var before standard paths on UNIX

Also document the variable.

Fixes: #18346
This commit is contained in:
Patric Schmitz
2020-05-06 13:33:48 +02:00
parent 00065e2087
commit 590cde6125

View File

@@ -28,6 +28,15 @@ The module will also define two cache variables::
Vulkan_INCLUDE_DIR - the Vulkan include directory
Vulkan_LIBRARY - the path to the Vulkan library
Hints
^^^^^
The ``VULKAN_SDK`` environment variable optionally specifies the
location of the Vulkan SDK root directory for the given
architecture. It is typically set by sourcing the toplevel
``setup-env.sh`` script of the Vulkan SDK directory into the shell
environment.
#]=======================================================================]
if(WIN32)
@@ -53,14 +62,12 @@ if(WIN32)
)
endif()
else()
find_path(Vulkan_INCLUDE_DIR
NAMES vulkan/vulkan.h
PATHS
"$ENV{VULKAN_SDK}/include")
find_library(Vulkan_LIBRARY
NAMES vulkan
PATHS
"$ENV{VULKAN_SDK}/lib")
find_path(Vulkan_INCLUDE_DIR
NAMES vulkan/vulkan.h
HINTS "$ENV{VULKAN_SDK}/include")
find_library(Vulkan_LIBRARY
NAMES vulkan
HINTS "$ENV{VULKAN_SDK}/lib")
endif()
set(Vulkan_LIBRARIES ${Vulkan_LIBRARY})