From 590cde6125f4ad787dacfe2f0fbd767ca2e48b5d Mon Sep 17 00:00:00 2001 From: Patric Schmitz Date: Wed, 6 May 2020 13:33:48 +0200 Subject: FindVulkan: Prefer VULKAN_SDK env var before standard paths on UNIX Also document the variable. Fixes: #18346 --- Modules/FindVulkan.cmake | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/Modules/FindVulkan.cmake b/Modules/FindVulkan.cmake index 7603124..4b999b6 100644 --- a/Modules/FindVulkan.cmake +++ b/Modules/FindVulkan.cmake @@ -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}) -- cgit v0.12