mirror of
https://github.com/neovim/neovim.git
synced 2024-12-19 10:45:16 -07:00
build: check if libvterm version meets requirement (#22010)
The vterm.h file only specifies major and minor version, but not patch, meaning that requiring a specific patch number isn't currently possible.
This commit is contained in:
parent
3c2bb1b2be
commit
843c9025ae
@ -1,10 +0,0 @@
|
||||
# - Try to find libvterm
|
||||
# Once done this will define
|
||||
# LIBVTERM_FOUND - System has libvterm
|
||||
# LIBVTERM_INCLUDE_DIRS - The libvterm include directories
|
||||
# LIBVTERM_LIBRARIES - The libraries needed to use libvterm
|
||||
|
||||
include(LibFindMacros)
|
||||
|
||||
libfind_pkg_detect(LIBVTERM vterm FIND_PATH vterm.h FIND_LIBRARY vterm)
|
||||
libfind_process(LIBVTERM REQUIRED)
|
20
cmake/Findlibvterm.cmake
Normal file
20
cmake/Findlibvterm.cmake
Normal file
@ -0,0 +1,20 @@
|
||||
find_path(LIBVTERM_INCLUDE_DIR vterm.h)
|
||||
find_library(LIBVTERM_LIBRARY vterm)
|
||||
|
||||
if(LIBVTERM_INCLUDE_DIR AND EXISTS "${LIBVTERM_INCLUDE_DIR}/vterm.h")
|
||||
file(STRINGS ${LIBVTERM_INCLUDE_DIR}/vterm.h VTERM_VERSION_MAJOR REGEX "#define VTERM_VERSION_MAJOR")
|
||||
string(REGEX MATCH "[0-9]+" VTERM_VERSION_MAJOR ${VTERM_VERSION_MAJOR})
|
||||
|
||||
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})
|
||||
endif()
|
||||
|
||||
find_package_handle_standard_args(libvterm
|
||||
REQUIRED_VARS LIBVTERM_INCLUDE_DIR LIBVTERM_LIBRARY
|
||||
VERSION_VAR VTERM_VERSION)
|
||||
|
||||
add_library(libvterm INTERFACE)
|
||||
target_include_directories(libvterm SYSTEM BEFORE INTERFACE INTERFACE ${LIBVTERM_INCLUDE_DIR})
|
||||
target_link_libraries(main_lib INTERFACE ${LIBVTERM_LIBRARY})
|
@ -30,9 +30,8 @@ find_package(LibTermkey 0.22 REQUIRED)
|
||||
target_include_directories(main_lib SYSTEM BEFORE INTERFACE ${LIBTERMKEY_INCLUDE_DIRS})
|
||||
target_link_libraries(main_lib INTERFACE ${LIBTERMKEY_LIBRARIES})
|
||||
|
||||
find_package(LIBVTERM 0.3 REQUIRED)
|
||||
target_include_directories(main_lib SYSTEM BEFORE INTERFACE ${LIBVTERM_INCLUDE_DIRS})
|
||||
target_link_libraries(main_lib INTERFACE ${LIBVTERM_LIBRARIES})
|
||||
find_package(libvterm 0.3 REQUIRED)
|
||||
target_link_libraries(main_lib INTERFACE libvterm)
|
||||
|
||||
find_package(Iconv REQUIRED)
|
||||
target_include_directories(main_lib SYSTEM BEFORE INTERFACE ${Iconv_INCLUDE_DIRS})
|
||||
|
Loading…
Reference in New Issue
Block a user