summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2021-11-11 15:47:29 (GMT)
committerKitware Robot <kwrobot@kitware.com>2021-11-11 15:48:26 (GMT)
commit1a0cd5399495e968b4a3992845d46c1bdaf32909 (patch)
tree225e5a7860b74c70f231daa19845b27ea31dcb44 /Modules
parent79354bf7a49fc7238463173cd45b097dc46cfc57 (diff)
parentdb8bd5965fcce423748b1dc3120505c6c30df00b (diff)
downloadCMake-1a0cd5399495e968b4a3992845d46c1bdaf32909.zip
CMake-1a0cd5399495e968b4a3992845d46c1bdaf32909.tar.gz
CMake-1a0cd5399495e968b4a3992845d46c1bdaf32909.tar.bz2
Merge topic 'FindVulkan-pre-1.2.175'
db8bd5965f FindVulkan: Fix finding versions < 1.2.175 Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !6717
Diffstat (limited to 'Modules')
-rw-r--r--Modules/FindVulkan.cmake13
1 files changed, 9 insertions, 4 deletions
diff --git a/Modules/FindVulkan.cmake b/Modules/FindVulkan.cmake
index 078e367..527ca8b 100644
--- a/Modules/FindVulkan.cmake
+++ b/Modules/FindVulkan.cmake
@@ -143,10 +143,15 @@ if(Vulkan_INCLUDE_DIR)
if(EXISTS ${VULKAN_CORE_H})
file(STRINGS ${VULKAN_CORE_H} VulkanHeaderVersionLine REGEX "^#define VK_HEADER_VERSION ")
string(REGEX MATCHALL "[0-9]+" VulkanHeaderVersion "${VulkanHeaderVersionLine}")
- file(STRINGS ${VULKAN_CORE_H} VulkanHeaderVersionLine REGEX "^#define VK_HEADER_VERSION_COMPLETE ")
- # "#define VK_HEADER_VERSION_COMPLETE VK_MAKE_API_VERSION(0, 1, 2, VK_HEADER_VERSION)"
- string(REGEX REPLACE ".*\\([0_9]+[, ]+([0-9]+)[, ]+([0-9]+)[, ].*\\)"
- "\\1.\\2.${VulkanHeaderVersion}" Vulkan_VERSION "${VulkanHeaderVersionLine}")
+ file(STRINGS ${VULKAN_CORE_H} VulkanHeaderVersionLine2 REGEX "^#define VK_HEADER_VERSION_COMPLETE ")
+ string(REGEX MATCHALL "[0-9]+" VulkanHeaderVersion2 "${VulkanHeaderVersionLine2}")
+ list(LENGTH VulkanHeaderVersion2 _len)
+ # versions >= 1.2.175 have an additional numbers in front of e.g. '0, 1, 2' instead of '1, 2'
+ if(_len EQUAL 3)
+ list(REMOVE_AT VulkanHeaderVersion2 0)
+ endif()
+ list(APPEND VulkanHeaderVersion2 ${VulkanHeaderVersion})
+ list(JOIN VulkanHeaderVersion2 "." Vulkan_VERSION)
endif()
endif()