From 78d4883ae13054c26440a79a876929a8617560b3 Mon Sep 17 00:00:00 2001 From: condy Date: Sun, 12 Apr 2020 20:07:17 +0800 Subject: Automatic detection for system libvterm first --- CMakeLists.txt | 19 +++++++++++++------ README.md | 12 ++++++------ 2 files changed, 19 insertions(+), 12 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index d46340c..7222ce6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -24,17 +24,24 @@ if (NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES) endif() # Look for the header file. -option(USE_SYSTEM_LIBVTERM "Use system libvterm instead of the vendored version." OFF) +option(USE_SYSTEM_LIBVTERM "Use system libvterm instead of the vendored version." ON) -if(USE_SYSTEM_LIBVTERM) - find_path(LIBVTERM_INCLUDE_DIR NAMES - vterm.h +# Try to find the libvterm in system. +if (USE_SYSTEM_LIBVTERM) + # try to find the vterm.h header file. + find_path(LIBVTERM_INCLUDE_DIR + NAMES vterm.h ) - if(NOT LIBVTERM_INCLUDE_DIR) - message(FATAL_ERROR "vterm.h not found") + # vterm.h is found. + if (LIBVTERM_INCLUDE_DIR) + message(STATUS "System libvterm detected.") + else() + message(STATUS "System libvterm not found. libvterm will be downloaded and compiled as part of the build process.") endif() +endif() +if (LIBVTERM_INCLUDE_DIR) find_library(LIBVTERM_LIBRARY NAMES vterm libvterm diff --git a/README.md b/README.md index 9881667..327ceef 100644 --- a/README.md +++ b/README.md @@ -64,12 +64,12 @@ Clone the repository: git clone https://github.com/akermu/emacs-libvterm.git ``` -In case you want to use the version of libvterm already installed on your -system, change `cmake ..` with `cmake -DUSE_SYSTEM_LIBVTERM=yes ..` in the -following instructions. If `-DUSE_SYSTEM_LIBVTERM` is not explicitly set to -`yes` (or if it is set to `no`), emacs-libvterm will download the latest version -available of libvterm (from [here](https://github.com/neovim/libvterm)), compile -it, and use it. +By default, vterm will try to find if libvterm is installed. If it is not found, +emacs-libvterm will download the latest version available of libvterm (from +[here](https://github.com/neovim/libvterm)), compile it, and use it. If you +always want to use the vendored version as opposed to the one on you system, set +`USE_SYSTEM_LIBVTERM` to `Off`. To do this, change `cmake ..` with `cmake +-DUSE_SYSTEM_LIBVTERM=Off ..` in the following instructions. Build the module with: -- cgit v1.0 From 887b01adadb86e909f4e3d0de014c3dcb2626e5a Mon Sep 17 00:00:00 2001 From: Gabriele Bozzola Date: Sun, 3 May 2020 22:43:31 -0700 Subject: Fix punctuation --- CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 7222ce6..42502e6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -35,9 +35,9 @@ if (USE_SYSTEM_LIBVTERM) # vterm.h is found. if (LIBVTERM_INCLUDE_DIR) - message(STATUS "System libvterm detected.") + message(STATUS "System libvterm detected") else() - message(STATUS "System libvterm not found. libvterm will be downloaded and compiled as part of the build process.") + message(STATUS "System libvterm not found: libvterm will be downloaded and compiled as part of the build process") endif() endif() -- cgit v1.0