Align naming of FindTreeSitter cmake file and variables

`find_package(Foo ...)` expects to find a file FindFoo.cmake and the
resulting variables to be named `Foo_...`.  If those don't all match up,
then the detection does not work properly.

Closes #13262
This commit is contained in:
James McCoy 2020-11-09 15:15:03 -05:00
parent 42ffa2d62e
commit 1451b14873
No known key found for this signature in database
GPG Key ID: DFE691AE331BA3DB
4 changed files with 14 additions and 14 deletions

View File

@ -374,8 +374,8 @@ include_directories(SYSTEM ${MSGPACK_INCLUDE_DIRS})
find_package(LibLUV 1.30.0 REQUIRED)
include_directories(SYSTEM ${LIBLUV_INCLUDE_DIRS})
find_package(Treesitter REQUIRED)
include_directories(SYSTEM ${TREESITTER_INCLUDE_DIRS})
find_package(TreeSitter REQUIRED)
include_directories(SYSTEM ${TreeSitter_INCLUDE_DIRS})
# Note: The test lib requires LuaJIT; it will be skipped if LuaJIT is missing.
option(PREFER_LUA "Prefer Lua over LuaJIT in the nvim executable." OFF)

View File

@ -0,0 +1,11 @@
# - Try to find tree-sitter
# Once done, this will define
#
# TreeSitter_FOUND - system has tree-sitter
# TreeSitter_INCLUDE_DIRS - the tree-sitter include directories
# TreeSitter_LIBRARIES - link these to use tree-sitter
include(LibFindMacros)
libfind_pkg_detect(TreeSitter tree-sitter FIND_PATH tree_sitter/api.h FIND_LIBRARY tree-sitter)
libfind_process(TreeSitter)

View File

@ -1,11 +0,0 @@
# - Try to find tree-sitter
# Once done, this will define
#
# TREESITTER_FOUND - system has tree-sitter
# TREESITTER_INCLUDE_DIRS - the tree-sitter include directories
# TREESITTER_LIBRARIES - link these to use tree-sitter
include(LibFindMacros)
libfind_pkg_detect(TREESITTER tree-sitter FIND_PATH tree_sitter/api.h FIND_LIBRARY tree-sitter)
libfind_process(TREESITTER)

View File

@ -445,7 +445,7 @@ list(APPEND NVIM_LINK_LIBRARIES
${LIBTERMKEY_LIBRARIES}
${UNIBILIUM_LIBRARIES}
${UTF8PROC_LIBRARIES}
${TREESITTER_LIBRARIES}
${TreeSitter_LIBRARIES}
${CMAKE_THREAD_LIBS_INIT}
)