diff options
author | Brad King <brad.king@kitware.com> | 2021-11-11 15:47:29 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2021-11-11 15:48:26 (GMT) |
commit | 1a0cd5399495e968b4a3992845d46c1bdaf32909 (patch) | |
tree | 225e5a7860b74c70f231daa19845b27ea31dcb44 /Modules | |
parent | 79354bf7a49fc7238463173cd45b097dc46cfc57 (diff) | |
parent | db8bd5965fcce423748b1dc3120505c6c30df00b (diff) | |
download | CMake-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.cmake | 13 |
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() |