support the optional return char in version.txt (added by github editor) (#370)
This commit is contained in:
Родитель
1c2cf57ae0
Коммит
7578af8361
|
@ -10,7 +10,7 @@ endif()
|
|||
function(read_version_file major_var minor_var patch_var)
|
||||
set(version_file ${PROJECT_SOURCE_DIR}/version.txt)
|
||||
file(READ ${version_file} version_file_content)
|
||||
if(version_file_content MATCHES "^([0-9]+)\\.([0-9]+)\\.([0-9]+)$")
|
||||
if(version_file_content MATCHES "^([0-9]+)\\.([0-9]+)\\.([0-9]+)[\n]?$")
|
||||
set(${major_var} ${CMAKE_MATCH_1} PARENT_SCOPE)
|
||||
set(${minor_var} ${CMAKE_MATCH_2} PARENT_SCOPE)
|
||||
set(${patch_var} ${CMAKE_MATCH_3} PARENT_SCOPE)
|
||||
|
|
Загрузка…
Ссылка в новой задаче