summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Young <marky@lunarg.com>2018-07-19 09:48:03 -0600
committerLenny Komow <lenny@lunarg.com>2018-07-20 09:34:08 -0600
commitfabaa4a74738a1133f199232d0999389c9e5710c (patch)
tree7b3cee3e289b36e978774a07cad7a0f298675ac6
parent11a2fb2206093b83d01aaad9a7603d754063ea06 (diff)
downloadVulkan-Loader-fabaa4a74738a1133f199232d0999389c9e5710c.tar.gz
Vulkan-Loader-fabaa4a74738a1133f199232d0999389c9e5710c.tar.bz2
Vulkan-Loader-fabaa4a74738a1133f199232d0999389c9e5710c.zip
loader: Fix detection of patch
Karl pointed out that the patch detection wasn't that future proof. Added his coding suggestions. Change-Id: Ieedd53776da1835a38ed1815a20775988df94900
-rw-r--r--cmake/FindVulkanHeaders.cmake8
1 files changed, 6 insertions, 2 deletions
diff --git a/cmake/FindVulkanHeaders.cmake b/cmake/FindVulkanHeaders.cmake
index 506c4f8d..41afa9b5 100644
--- a/cmake/FindVulkanHeaders.cmake
+++ b/cmake/FindVulkanHeaders.cmake
@@ -121,10 +121,14 @@ foreach(VulkanHeaders_line ${VulkanHeaders_lines})
# Format is:
# #define VK_HEADER_VERSION Z
# Where Z is the patch version which we just grab off the end
- string(REGEX MATCH "define.*VK_HEADER_VERSION.*" VulkanHeaders_out ${VulkanHeaders_line})
+ string(REGEX MATCH "define.*VK_HEADER_VERSION.*[0-9]+" VulkanHeaders_out ${VulkanHeaders_line})
list(LENGTH VulkanHeaders_out VulkanHeaders_len)
if (VulkanHeaders_len)
- string(REGEX MATCHALL "[0-9]+" VulkanHeaders_VERSION_PATCH "${VulkanHeaders_out}")
+ string(REGEX MATCH "[0-9]+" VulkanHeaders_VERSION_PATCH "${VulkanHeaders_out}")
endif()
endforeach()
+MESSAGE(STATUS
+ "Detected Vulkan Version ${VulkanHeaders_VERSION_MAJOR}."
+ "${VulkanHeaders_VERSION_MINOR}."
+ "${VulkanHeaders_VERSION_PATCH}")