diff options
author | Juan Ramos <[email protected]> | 2023-01-10 13:40:55 -0700 |
---|---|---|
committer | Juan Ramos <[email protected]> | 2023-01-10 13:44:50 -0700 |
commit | bc6beaa9602e94fa9c66a41c4a890884f6aaa661 (patch) | |
tree | 86048fb32d460c309c8193254b9a7e2509533843 /CMakeLists.txt | |
parent | 1a8e782743e40a2949b92f4cc3905cb85fe2c181 (diff) | |
download | Vulkan-Headers-bc6beaa9602e94fa9c66a41c4a890884f6aaa661.tar.gz Vulkan-Headers-bc6beaa9602e94fa9c66a41c4a890884f6aaa661.zip |
cmake: Cleanup vlk_get_header_version
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 00bf92b..7c9d985 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -16,8 +16,6 @@ # ~~~ cmake_minimum_required(VERSION 3.10.2) -# Written as a function to minimize variable scope -# Only VK_VERSION_STRING will be returned to the PARENT_SCOPE function(vlk_get_header_version) set(vulkan_core_header_file "${CMAKE_CURRENT_SOURCE_DIR}/include/vulkan/vulkan_core.h") if (NOT EXISTS ${vulkan_core_header_file}) @@ -26,7 +24,6 @@ function(vlk_get_header_version) file(READ ${vulkan_core_header_file} ver) - # Get the major/minor version if (ver MATCHES "#define[ ]+VK_HEADER_VERSION_COMPLETE[ ]+VK_MAKE_API_VERSION\\([ ]*[0-9]+,[ ]*([0-9]+),[ ]*([0-9]+),[ ]*VK_HEADER_VERSION[ ]*\\)") set(VK_VERSION_MAJOR "${CMAKE_MATCH_1}") set(VK_VERSION_MINOR "${CMAKE_MATCH_2}") @@ -34,14 +31,13 @@ function(vlk_get_header_version) message(FATAL_ERROR "Couldn't get major/minor version") endif() - # Get the patch version if (ver MATCHES "#define[ ]+VK_HEADER_VERSION[ ]+([0-9]+)") - set(VK_HEADER_VERSION "${CMAKE_MATCH_1}") + set(VK_PATCH_VERSION "${CMAKE_MATCH_1}") else() message(FATAL_ERROR "Couldn't get the patch version") endif() - set(VK_VERSION_STRING "${VK_VERSION_MAJOR}.${VK_VERSION_MINOR}.${VK_HEADER_VERSION}" PARENT_SCOPE) + set(VK_VERSION_STRING "${VK_VERSION_MAJOR}.${VK_VERSION_MINOR}.${VK_PATCH_VERSION}" PARENT_SCOPE) endfunction() vlk_get_header_version() |