Adapt to change of AC_INIT in configure.ac.

Amends 2849127f44, missed it at that time
This commit is contained in:
Kornel Benko 2022-11-15 14:38:56 +01:00
parent ce6e803cbd
commit 22e78cae81

View File

@ -346,6 +346,9 @@ endif()
macro(setstripped _varname)
if(${ARGC} GREATER 1)
string(STRIP "${ARGV1}" _v)
if (_v MATCHES "^\\[\(.+\)\\]$")
set(_v ${CMAKE_MATCH_1})
endif()
if(USE_POSIX_PACKAGING)
string(TOLOWER ${_v} ${_varname})
else()
@ -358,10 +361,13 @@ endmacro(setstripped)
foreach(_c_l ${_config_lines} )
if(_c_l MATCHES "^AC_INIT\\(\([^,]+\),\([^,]+\), *\\[\([^,]+\)\\] *,\(.*\)")
setstripped(PACKAGE_BASE ${CMAKE_MATCH_1})
setstripped(PACKAGE_VERSION ${CMAKE_MATCH_2})
setstripped(PACKAGE_BUGREPORT ${CMAKE_MATCH_3})
if(PACKAGE_VERSION MATCHES "^\([0-9]+\)\\.\([0-9]+\)\(\\.\([0-9]+\)\(\\.\([0-9]+\)\)?\)?.*$")
set(_PB ${CMAKE_MATCH_1})
set(_PV ${CMAKE_MATCH_2})
set(_PBU ${CMAKE_MATCH_3})
setstripped(PACKAGE_BASE ${_PB})
setstripped(PACKAGE_VERSION ${_PV})
setstripped(PACKAGE_BUGREPORT ${_PBU})
if(PACKAGE_VERSION MATCHES "^\([0-9]+\)\\.\([0-9]+\)\(\\.\([0-9]+\)\(\\.\([0-9]+\)\)?\)?-?\([a-z]*[0-9]*\).*$")
set(LYX_MAJOR_VERSION ${CMAKE_MATCH_1})
set(LYX_MINOR_VERSION ${CMAKE_MATCH_2})
set(LYX_RELEASE_LEVEL ${CMAKE_MATCH_4})