Skip to content

Commit

Permalink
Fix parsing of HAL version number from file
Browse files Browse the repository at this point in the history
  • Loading branch information
joern274 committed May 11, 2023
1 parent 29f4c0d commit 1c49926
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions cmake/hal_cmake_tools.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ function(hal_get_version)
if(VERSION_LIST STREQUAL "")
file(READ ${CMAKE_SOURCE_DIR}/CURRENT_VERSION VERSION_FILE)
message(VERBOSE "VERSION_FILE: ${VERSION_FILE}")
string(REGEX MATCHALL "v([0-9]+)\.([0-9]+)\.([0-9]+)" match ${VERSION_FILE})
set(VERSION_FILE "v${VERSION_FILE}")
string(STRIP ${VERSION_FILE} VERSION_FILE)
string(REGEX MATCHALL "v+([0-9]+)\.([0-9]+)\.([0-9]+)" match ${VERSION_FILE})
if(NOT ${match} EQUAL "")
set(HAL_VERSION_RETURN ${VERSION_FILE} PARENT_SCOPE)
message(STATUS "HAL_VERSION_RETURN: ${HAL_VERSION_RETURN}")
Expand Down Expand Up @@ -232,4 +234,4 @@ macro(configure_files src_dir dst_dir extension)
@ONLY)
endif(NOT IS_DIRECTORY ${file_path_to_copy})
endforeach(file_to_copy)
endmacro(configure_files)
endmacro(configure_files)

0 comments on commit 1c49926

Please sign in to comment.