mirror of
https://github.com/neovim/neovim.git
synced 2025-09-06 19:38:20 +00:00
build: port FindLibVterm to LibFindMacros (#10395)
This commit is contained in:
@@ -4,28 +4,7 @@
|
|||||||
# LIBVTERM_INCLUDE_DIRS - The libvterm include directories
|
# LIBVTERM_INCLUDE_DIRS - The libvterm include directories
|
||||||
# LIBVTERM_LIBRARIES - The libraries needed to use libvterm
|
# LIBVTERM_LIBRARIES - The libraries needed to use libvterm
|
||||||
|
|
||||||
find_package(PkgConfig)
|
include(LibFindMacros)
|
||||||
if (PKG_CONFIG_FOUND)
|
|
||||||
pkg_check_modules(PC_LIBVTERM QUIET vterm)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
set(LIBVTERM_DEFINITIONS ${PC_LIBVTERM_CFLAGS_OTHER})
|
libfind_pkg_detect(LIBVTERM vterm FIND_PATH vterm.h FIND_LIBRARY vterm)
|
||||||
|
libfind_process(LIBVTERM REQUIRED)
|
||||||
find_path(LIBVTERM_INCLUDE_DIR vterm.h
|
|
||||||
PATHS ${PC_LIBVTERM_INCLUDEDIR} ${PC_LIBVTERM_INCLUDE_DIRS})
|
|
||||||
|
|
||||||
list(APPEND LIBVTERM_NAMES vterm)
|
|
||||||
|
|
||||||
find_library(LIBVTERM_LIBRARY NAMES ${LIBVTERM_NAMES}
|
|
||||||
HINTS ${PC_LIBVTERM_LIBDIR} ${PC_LIBVTERM_LIBRARY_DIRS})
|
|
||||||
|
|
||||||
set(LIBVTERM_LIBRARIES ${LIBVTERM_LIBRARY})
|
|
||||||
set(LIBVTERM_INCLUDE_DIRS ${LIBVTERM_INCLUDE_DIR})
|
|
||||||
|
|
||||||
include(FindPackageHandleStandardArgs)
|
|
||||||
# handle the QUIETLY and REQUIRED arguments and set LIBVTERM_FOUND to TRUE
|
|
||||||
# if all listed variables are TRUE
|
|
||||||
find_package_handle_standard_args(LibVterm DEFAULT_MSG
|
|
||||||
LIBVTERM_LIBRARY LIBVTERM_INCLUDE_DIR)
|
|
||||||
|
|
||||||
mark_as_advanced(LIBVTERM_INCLUDE_DIR LIBVTERM_LIBRARY)
|
|
||||||
|
Reference in New Issue
Block a user