mirror of
https://git.proxmox.com/git/libgit2
synced 2025-05-09 13:04:42 +00:00
cmake: generate tags
This commit is contained in:
parent
86a459a843
commit
e632f68789
@ -49,6 +49,7 @@ OPTION (BUILD_SHARED_LIBS "Build Shared Library (OFF for Static)" ON)
|
||||
OPTION (THREADSAFE "Build libgit2 as threadsafe" OFF)
|
||||
OPTION (BUILD_TESTS "Build Tests" ON)
|
||||
OPTION (BUILD_CLAY "Build Tests using the Clay suite" OFF)
|
||||
OPTION (TAGS "Generate tags" OFF)
|
||||
|
||||
# Platform specific compilation flags
|
||||
IF (MSVC)
|
||||
@ -168,3 +169,22 @@ IF (BUILD_CLAY)
|
||||
ENABLE_TESTING()
|
||||
ADD_TEST(libgit2_clay libgit2_clay)
|
||||
ENDIF ()
|
||||
|
||||
IF (TAGS)
|
||||
FIND_PROGRAM(CTAGS ctags)
|
||||
IF (NOT CTAGS)
|
||||
message(FATAL_ERROR "Could not find ctags command")
|
||||
ENDIF ()
|
||||
|
||||
FILE(GLOB_RECURSE SRC_ALL *.[ch])
|
||||
|
||||
ADD_CUSTOM_COMMAND(
|
||||
OUTPUT tags
|
||||
COMMAND ${CTAGS} -a ${SRC_ALL}
|
||||
DEPENDS ${SRC_ALL}
|
||||
)
|
||||
ADD_CUSTOM_TARGET(
|
||||
do_tags ALL
|
||||
DEPENDS tags
|
||||
)
|
||||
ENDIF ()
|
||||
|
Loading…
Reference in New Issue
Block a user