deps: Add libvterm to the project dependencies

libvterm is a terminal emulation library with abstract display. It will be used
to implement builtin terminal emulation into Nvim.
This commit is contained in:
Thiago de Arruda 2015-02-28 10:41:53 -03:00
parent 585e5d32a3
commit 81a346553c
4 changed files with 81 additions and 1 deletions

View File

@ -195,6 +195,10 @@ set(LIBTERMKEY_USE_STATIC ON)
find_package(LibTermkey REQUIRED)
include_directories(SYSTEM ${LIBTERMEY_INCLUDE_DIRS})
set(LIBVTERM_USE_STATIC ON)
find_package(LibVterm REQUIRED)
include_directories(SYSTEM ${LIBVTERM_INCLUDE_DIRS})
find_package(LibIntl)
if(LibIntl_FOUND)
include_directories(SYSTEM ${LibIntl_INCLUDE_DIRS})

48
cmake/FindLibVterm.cmake Normal file
View File

@ -0,0 +1,48 @@
# - 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
find_package(PkgConfig)
if(NOT LIBVTERM_USE_BUNDLED)
find_package(PkgConfig)
if (PKG_CONFIG_FOUND)
pkg_check_modules(PC_LIBVTERM QUIET vterm)
endif()
else()
set(PC_LIBVTERM_INCLUDEDIR)
set(PC_LIBVTERM_INCLUDE_DIRS)
set(PC_LIBVTERM_LIBDIR)
set(PC_LIBVTERM_LIBRARY_DIRS)
set(LIMIT_SEARCH NO_DEFAULT_PATH)
endif()
set(LIBVTERM_DEFINITIONS ${PC_LIBVTERM_CFLAGS_OTHER})
find_path(LIBVTERM_INCLUDE_DIR vterm.h
PATHS ${PC_LIBVTERM_INCLUDEDIR} ${PC_LIBVTERM_INCLUDE_DIRS}
${LIMIT_SEARCH})
# If we're asked to use static linkage, add libuv.a as a preferred library name.
if(LIBVTERM_USE_STATIC)
list(APPEND LIBVTERM_NAMES
"${CMAKE_STATIC_LIBRARY_PREFIX}vterm${CMAKE_STATIC_LIBRARY_SUFFIX}")
endif()
list(APPEND LIBVTERM_NAMES vterm)
find_library(LIBVTERM_LIBRARY NAMES ${LIBVTERM_NAMES}
HINTS ${PC_LIBVTERM_LIBDIR} ${PC_LIBVTERM_LIBRARY_DIRS}
${LIMIT_SEARCH})
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)

View File

@ -171,7 +171,7 @@ list(APPEND NVIM_LINK_LIBRARIES
${LIBUV_LIBRARIES}
${MSGPACK_LIBRARIES}
${LUAJIT_LIBRARIES}
${LIBTICKIT_LIBRARIES}
${LIBVTERM_LIBRARIES}
${LIBTERMKEY_LIBRARIES}
${LIBUNIBILIUM_LIBRARIES}
m

View File

@ -12,6 +12,7 @@ option(USE_BUNDLED "Use bundled dependencies." ON)
option(USE_BUNDLED_LIBUNIBILIUM "Use the bundled libunibilium." ${USE_BUNDLED})
option(USE_BUNDLED_LIBTERMKEY "Use the bundled libtermkey." ${USE_BUNDLED})
option(USE_BUNDLED_LIBVTERM "Use the bundled libvterm." ${USE_BUNDLED})
option(USE_BUNDLED_LIBUV "Use the bundled libuv." ${USE_BUNDLED})
option(USE_BUNDLED_MSGPACK "Use the bundled msgpack." ${USE_BUNDLED})
option(USE_BUNDLED_LUAJIT "Use the bundled version of luajit." ${USE_BUNDLED})
@ -66,6 +67,10 @@ set(LIBUNIBILIUM_SHA1 32c07797f298e5bc722ce14b6b9a2cae68e3c018)
set(LIBTERMKEY_URL https://github.com/neovim/libtermkey/archive/8c0cb7108cc63218ea19aa898968eede19e19603.tar.gz)
set(LIBTERMKEY_SHA1 54e8b6914dab10d4467d2a563f80053a99849fcb)
set(LIBVTERM_URL https://github.com/neovim/libvterm/archive/ec80d6cc2f331263b76ec40acb4e6b2184a969d9.tar.gz)
set(LIBVTERM_SHA1 4e3cf232977bb829baa1746c20e846dd054981c0)
if(USE_BUNDLED_LIBUNIBILIUM)
ExternalProject_Add(libunibilium
PREFIX ${DEPS_BUILD_DIR}
@ -111,6 +116,29 @@ if(USE_BUNDLED_LIBTERMKEY)
add_dependencies(libtermkey libunibilium)
endif()
if(USE_BUNDLED_LIBVTERM)
ExternalProject_Add(libvterm
PREFIX ${DEPS_BUILD_DIR}
URL ${LIBVTERM_URL}
DOWNLOAD_DIR ${DEPS_DOWNLOAD_DIR}/libvterm
DOWNLOAD_COMMAND ${CMAKE_COMMAND}
-DPREFIX=${DEPS_BUILD_DIR}
-DDOWNLOAD_DIR=${DEPS_DOWNLOAD_DIR}/libvterm
-DURL=${LIBVTERM_URL}
-DEXPECTED_SHA1=${LIBVTERM_SHA1}
-DTARGET=libvterm
-P ${CMAKE_CURRENT_SOURCE_DIR}/cmake/DownloadAndExtractFile.cmake
CONFIGURE_COMMAND ""
BUILD_IN_SOURCE 1
BUILD_COMMAND ""
INSTALL_COMMAND ${MAKE_PRG} CC=${DEPS_C_COMPILER}
PREFIX=${DEPS_INSTALL_DIR}
CFLAGS=-fPIC
install)
list(APPEND THIRD_PARTY_DEPS libvterm)
endif()
if(USE_BUNDLED_LIBUV)
ExternalProject_Add(libuv
PREFIX ${DEPS_BUILD_DIR}