2023-10-10 14:18:45 -07:00
|
|
|
find_path2(LIBVTERM_INCLUDE_DIR vterm.h)
|
|
|
|
find_library2(LIBVTERM_LIBRARY vterm)
|
2023-01-26 13:35:06 -07:00
|
|
|
|
|
|
|
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()
|
|
|
|
|
2023-03-02 14:50:43 -07:00
|
|
|
find_package_handle_standard_args(Libvterm
|
2023-01-26 13:35:06 -07:00
|
|
|
REQUIRED_VARS LIBVTERM_INCLUDE_DIR LIBVTERM_LIBRARY
|
|
|
|
VERSION_VAR VTERM_VERSION)
|
|
|
|
|
|
|
|
add_library(libvterm INTERFACE)
|
2023-02-07 13:37:16 -07:00
|
|
|
target_include_directories(libvterm SYSTEM BEFORE INTERFACE ${LIBVTERM_INCLUDE_DIR})
|
2023-01-27 06:16:31 -07:00
|
|
|
target_link_libraries(libvterm INTERFACE ${LIBVTERM_LIBRARY})
|
2023-02-10 12:20:18 -07:00
|
|
|
|
|
|
|
mark_as_advanced(LIBVTERM_INCLUDE_DIR LIBVTERM_LIBRARY)
|