summaryrefslogtreecommitdiffstats
path: root/cmake
diff options
context:
space:
mode:
authorAlexandru Croitor <alexandru.croitor@qt.io>2021-07-28 11:14:32 +0200
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2021-07-29 15:43:13 +0000
commit9cd94777f90a08862fb650b1b2ce46e610bc5bbf (patch)
tree27961e49f193ff67c293cb1d5adf50dcf2c36fd7 /cmake
parenteaa1f533383efb79fd67ee3c180aa483a04519fb (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. Fixes: QTBUG-80576 Change-Id: I030b2fdeaafdd7bf5ebe6fb4c9ea860917e84056 Reviewed-by: Alexey Edelev <alexey.edelev@qt.io> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> (cherry picked from commit 3b2157ed9e738ea03028afd5e8a71b5c54eb3937) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'cmake')
-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)