TreesitterCMakeLists.txt 600 B

12345678910111213141516171819202122
  1. cmake_minimum_required(VERSION 2.8.12)
  2. project(tree-sitter LANGUAGES C)
  3. file(GLOB SRC_FILES ${PROJECT_SOURCE_DIR}/lib/src/*.c)
  4. foreach(sfile ${SRC_FILES})
  5. get_filename_component(f ${sfile} NAME)
  6. if(${f} MATCHES "lib.c$")
  7. list(REMOVE_ITEM SRC_FILES ${sfile})
  8. endif()
  9. endforeach()
  10. include_directories(${PROJECT_SOURCE_DIR}/lib/include)
  11. add_library(tree-sitter ${SRC_FILES})
  12. install(FILES
  13. lib/include/tree_sitter/api.h
  14. lib/include/tree_sitter/parser.h
  15. DESTINATION include/tree_sitter)
  16. include(GNUInstallDirs)
  17. install(TARGETS tree-sitter
  18. LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})