build: bump required minimum libvterm version to 0.3.3

Also add detection for libvterm patch version.
This commit is contained in:
dundargoc
2023-10-25 16:54:20 +02:00
committed by dundargoc
parent ac353e87ae
commit 7a5effb0f9
2 changed files with 11 additions and 2 deletions

View File

@ -8,7 +8,16 @@ if(LIBVTERM_INCLUDE_DIR AND EXISTS "${LIBVTERM_INCLUDE_DIR}/vterm.h")
file(STRINGS ${LIBVTERM_INCLUDE_DIR}/vterm.h VTERM_VERSION_MINOR REGEX "#define VTERM_VERSION_MINOR")
string(REGEX MATCH "[0-9]+" VTERM_VERSION_MINOR ${VTERM_VERSION_MINOR})
set(VTERM_VERSION ${VTERM_VERSION_MAJOR}.${VTERM_VERSION_MINOR})
file(STRINGS ${LIBVTERM_INCLUDE_DIR}/vterm.h VTERM_VERSION_PATCH REGEX "#define VTERM_VERSION_PATCH")
# The following is needed to give a coherent error for versions 0.3.2 and
# smaller.
if(VTERM_VERSION_PATCH)
string(REGEX MATCH "[0-9]+" VTERM_VERSION_PATCH ${VTERM_VERSION_PATCH})
string(PREPEND VTERM_VERSION_PATCH ".")
endif()
set(VTERM_VERSION ${VTERM_VERSION_MAJOR}.${VTERM_VERSION_MINOR}${VTERM_VERSION_PATCH})
endif()
find_package_handle_standard_args(Libvterm