aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames McCoy <jamessan@jamessan.com>2020-11-09 15:15:03 -0500
committerJames McCoy <jamessan@jamessan.com>2020-11-09 15:15:03 -0500
commit1451b1487355e3186d857919c4009934f247064d (patch)
tree0b32755968b3ae788abeca1b866bb31ced85fb04
parent42ffa2d62ee714a165d56f5fa8022a32c7534d71 (diff)
downloadrneovim-1451b1487355e3186d857919c4009934f247064d.tar.gz
rneovim-1451b1487355e3186d857919c4009934f247064d.tar.bz2
rneovim-1451b1487355e3186d857919c4009934f247064d.zip
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
-rw-r--r--CMakeLists.txt4
-rw-r--r--cmake/FindTreeSitter.cmake11
-rw-r--r--cmake/FindTreesitter.cmake11
-rw-r--r--src/nvim/CMakeLists.txt2
4 files changed, 14 insertions, 14 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index e290500175..94c8583b22 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -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)
diff --git a/cmake/FindTreeSitter.cmake b/cmake/FindTreeSitter.cmake
new file mode 100644
index 0000000000..ae0928e9f7
--- /dev/null
+++ b/cmake/FindTreeSitter.cmake
@@ -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)
diff --git a/cmake/FindTreesitter.cmake b/cmake/FindTreesitter.cmake
deleted file mode 100644
index 8ba3b72d28..0000000000
--- a/cmake/FindTreesitter.cmake
+++ /dev/null
@@ -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)
diff --git a/src/nvim/CMakeLists.txt b/src/nvim/CMakeLists.txt
index c8783f5bfe..9b6e9fe13e 100644
--- a/src/nvim/CMakeLists.txt
+++ b/src/nvim/CMakeLists.txt
@@ -445,7 +445,7 @@ list(APPEND NVIM_LINK_LIBRARIES
${LIBTERMKEY_LIBRARIES}
${UNIBILIUM_LIBRARIES}
${UTF8PROC_LIBRARIES}
- ${TREESITTER_LIBRARIES}
+ ${TreeSitter_LIBRARIES}
${CMAKE_THREAD_LIBS_INIT}
)