Browse Source

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
pull/13263/head
James McCoy 2 months ago
parent
commit
1451b14873
No known key found for this signature in database GPG Key ID: DFE691AE331BA3DB
4 changed files with 14 additions and 14 deletions
  1. +2
    -2
      CMakeLists.txt
  2. +11
    -0
      cmake/FindTreeSitter.cmake
  3. +0
    -11
      cmake/FindTreesitter.cmake
  4. +1
    -1
      src/nvim/CMakeLists.txt

+ 2
- 2
CMakeLists.txt 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)

+ 11
- 0
cmake/FindTreeSitter.cmake 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)

+ 0
- 11
cmake/FindTreesitter.cmake 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)

+ 1
- 1
src/nvim/CMakeLists.txt 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}
)

Loading…
Cancel
Save