summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexandru Croitor <alexandru.croitor@qt.io>2021-07-28 11:14:32 +0200
committerAlexandru Croitor <alexandru.croitor@qt.io>2021-07-29 16:38:49 +0200
commit3b2157ed9e738ea03028afd5e8a71b5c54eb3937 (patch)
tree4d4605ab62c9caae2aca17047dac23e0ff8e96a8
parentedba9cddbb7f2e68436ee256d4471909e33d288f (diff)
CMake: Fix MoltenVK headers to be found on macOS
This fixes building Qt with Vulkan support on macOS which aside from the regular Vulkan headers also needs the location of the MoltenVK headers. This assumes the usage of the LunarG Vulkan SDK for macOS. Pick-to: 6.2 Fixes: QTBUG-80576 Change-Id: I030b2fdeaafdd7bf5ebe6fb4c9ea860917e84056 Reviewed-by: Alexey Edelev <alexey.edelev@qt.io> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
-rw-r--r--cmake/FindWrapVulkanHeaders.cmake13
1 files changed, 13 insertions, 0 deletions
diff --git a/cmake/FindWrapVulkanHeaders.cmake b/cmake/FindWrapVulkanHeaders.cmake
index a079e07300..766f1e29eb 100644
--- a/cmake/FindWrapVulkanHeaders.cmake
+++ b/cmake/FindWrapVulkanHeaders.cmake
@@ -17,6 +17,19 @@ if(Vulkan_INCLUDE_DIR)
add_library(WrapVulkanHeaders::WrapVulkanHeaders INTERFACE IMPORTED)
target_include_directories(WrapVulkanHeaders::WrapVulkanHeaders INTERFACE
${Vulkan_INCLUDE_DIR})
+
+ # Also propagate MoltenVK include directory on Apple platforms if found.
+ # Assumes the folder structure of the LunarG Vulkan SDK.
+ if(APPLE)
+ set(__qt_molten_vk_include_path "${Vulkan_INCLUDE_DIR}/../../MoltenVK/include")
+ get_filename_component(
+ __qt_molten_vk_include_path
+ "${__qt_molten_vk_include_path}" ABSOLUTE)
+ if(EXISTS "${__qt_molten_vk_include_path}")
+ target_include_directories(WrapVulkanHeaders::WrapVulkanHeaders INTERFACE
+ ${__qt_molten_vk_include_path})
+ endif()
+ endif()
endif()
include(FindPackageHandleStandardArgs)