From 266833acfa419a15cc3ee5dfa0ffdd14cb08c920 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Morten=20Johan=20S=C3=B8rvig?= Date: Mon, 11 Oct 2021 22:54:29 +0200 Subject: [PATCH] Support MoltenVK from homebrew MoltenVK installed from homebrew has the following directory structure: molten-vk/1.1.5/libexec/include/vulkan/vulkan.h molten-vk/1.1.5/include/MoltenVK/mvk_vulkan.h Task-number: QTBUG-80576 Change-Id: If6f5aeb55908f60fff49417ee1ddf4c2db980c5a Reviewed-by: Alexandru Croitor (cherry picked from commit a34a10c11f11c99f35696874b5a82d6e843ebec2) Reviewed-by: Qt Cherry-pick Bot --- cmake/FindWrapVulkanHeaders.cmake | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/cmake/FindWrapVulkanHeaders.cmake b/cmake/FindWrapVulkanHeaders.cmake index ccbcf7f7082..ac2c912a56a 100644 --- a/cmake/FindWrapVulkanHeaders.cmake +++ b/cmake/FindWrapVulkanHeaders.cmake @@ -25,8 +25,8 @@ if(Vulkan_INCLUDE_DIR) _qt_skip_include_dir_for_pri TRUE) # Also propagate MoltenVK include directory on Apple platforms if found. - # Assumes the folder structure of the LunarG Vulkan SDK. if(APPLE) + # Check for the LunarG Vulkan SDK folder structure. set(__qt_molten_vk_include_path "${Vulkan_INCLUDE_DIR}/../../MoltenVK/include") get_filename_component( __qt_molten_vk_include_path @@ -35,6 +35,16 @@ if(Vulkan_INCLUDE_DIR) target_include_directories(WrapVulkanHeaders::WrapVulkanHeaders INTERFACE ${__qt_molten_vk_include_path}) endif() + + # Check for homebrew molten-vk folder structure + set(__qt_molten_vk_homebrew_include_path "${Vulkan_INCLUDE_DIR}/../../include") + get_filename_component( + __qt_molten_vk_homebrew_include_path + "${__qt_molten_vk_homebrew_include_path}" ABSOLUTE) + if(EXISTS "${__qt_molten_vk_homebrew_include_path}") + target_include_directories(WrapVulkanHeaders::WrapVulkanHeaders INTERFACE + ${__qt_molten_vk_homebrew_include_path}) + endif() endif() endif()