diff --git a/cmake/check_vulkan_version.cmake b/cmake/check_vulkan_version.cmake index 56d8c44f..0372d320 100644 --- a/cmake/check_vulkan_version.cmake +++ b/cmake/check_vulkan_version.cmake @@ -11,7 +11,7 @@ function(check_vulkan_version) file(STRINGS ${VULKAN_CORE_H} VULKAN_HEADER_VERSION_LINE REGEX "^#define VK_HEADER_VERSION ") string(REGEX MATCHALL "[0-9]+" VULKAN_HEADER_VERSION "${VULKAN_HEADER_VERSION_LINE}") file(STRINGS ${VULKAN_CORE_H} VULKAN_HEADER_VERSION_LINE2 REGEX "^#define VK_HEADER_VERSION_COMPLETE ") - if(${VULKAN_HEADER_VERSION_LINE2}) + if(NOT ${VULKAN_HEADER_VERSION_LINE2} STREQUAL "") string(REGEX MATCHALL "[0-9]+" VULKAN_HEADER_VERSION2 "${VULKAN_HEADER_VERSION_LINE2}") list(LENGTH VULKAN_HEADER_VERSION2 _len) # Versions >= 1.2.175 have an additional numbers in front of e.g. '0, 1, 2' instead of '1, 2' @@ -71,7 +71,7 @@ function(check_vulkan_version) message(FATAL_ERROR "No GPU supporting Vulkan found in vulkaninfo. Does your GPU (driver) support Vulkan?") endif() - string(REGEX MATCHALL "apiVersion[ ]*=[ ]*[0-9a-fA-F]+[ ]+[(]([0-9]+[.][0-9]+[.][0-9]+)[)]" GPU_API_VERSIONS ${VULKAN_INFO_OUTPUT}) + string(REGEX MATCHALL "apiVersion[ ]*=[ ]*[0-9a-fA-F]*[ ]*[(]*([0-9]+[.][0-9]+[.][0-9]+)[)]*" GPU_API_VERSIONS ${VULKAN_INFO_OUTPUT}) if(NOT GPU_API_VERSIONS) message(FATAL_ERROR "No valid Vulkan API version found in vulkaninfo. Does your GPU (driver) support Vulkan?") endif() @@ -93,7 +93,7 @@ function(check_vulkan_version) list(GET GPU_API_VERSIONS ${INDEX} API_VERSION) # Extract API version - if(${API_VERSION} MATCHES "apiVersion[ ]*=[ ]*[0-9a-fA-F]+[ ]+[(]([0-9]+[.][0-9]+[.][0-9]+)[)]") + if(${API_VERSION} MATCHES "apiVersion[ ]*=[ ]*[0-9a-fA-F]*[ ]*[(]*([0-9]+[.][0-9]+[.][0-9]+)[)]*") set(VULKAN_DRIVER_VERSION ${CMAKE_MATCH_1}) else() message(FATAL_ERROR "API version match failed. This should not have happened...")