neovim/cmake.deps/cmake/TreesitterCMakeLists.txt
dundargoc bf0d7ed1f6 build: bump minimum cmake version for all dependencies to 3.10
This removes cmake policy warning for CMP0053 on windows and ensures the
build works correctly for newer cmake policies.
2022-08-13 21:22:07 +02:00

22 lines
598 B
CMake

cmake_minimum_required(VERSION 3.10)
project(tree-sitter LANGUAGES C)
file(GLOB SRC_FILES ${PROJECT_SOURCE_DIR}/lib/src/*.c)
foreach(sfile ${SRC_FILES})
get_filename_component(f ${sfile} NAME)
if(${f} MATCHES "lib.c$")
list(REMOVE_ITEM SRC_FILES ${sfile})
endif()
endforeach()
include_directories(${PROJECT_SOURCE_DIR}/lib/include)
add_library(tree-sitter ${SRC_FILES})
install(FILES
lib/include/tree_sitter/api.h
lib/include/tree_sitter/parser.h
DESTINATION include/tree_sitter)
include(GNUInstallDirs)
install(TARGETS tree-sitter
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})