From 44ca111c2b9cf45491edc99062f89c89060525ae Mon Sep 17 00:00:00 2001 From: Dimitri Staessens Date: Fri, 1 May 2026 19:20:23 +0200 Subject: build: Add a 'tags' target for ctags index generation The build will now detect presence of ctags, and allows generating a tags file with 'make tags' for convenience. Signed-off-by: Dimitri Staessens Signed-off-by: Sander Vrijders --- cmake/tags.cmake | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 cmake/tags.cmake (limited to 'cmake') diff --git a/cmake/tags.cmake b/cmake/tags.cmake new file mode 100644 index 00000000..00e6f0d6 --- /dev/null +++ b/cmake/tags.cmake @@ -0,0 +1,21 @@ +find_program(CTAGS_EXECUTABLE + NAMES ctags-universal universal-ctags ctags + DOC "Generate a ctags index for source navigation: make tags") +mark_as_advanced(CTAGS_EXECUTABLE) + +if(CTAGS_EXECUTABLE) + add_custom_target(tags + COMMAND ${CTAGS_EXECUTABLE} + -R + --languages=C + --c-kinds=+p + --fields=+S + --exclude=build + --exclude=build-claude + --exclude=build_tmp + --exclude=.git + -f ${CMAKE_SOURCE_DIR}/tags + ${CMAKE_SOURCE_DIR} + WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} + COMMENT "Generating ctags index at ${CMAKE_SOURCE_DIR}/tags") +endif() -- cgit v1.2.3