diff options
author | Tor Didriksen <tor.didriksen@oracle.com> | 2018-07-03 12:30:19 +0200 |
---|---|---|
committer | Tor Didriksen <tor.didriksen@oracle.com> | 2018-07-19 07:42:48 +0200 |
commit | 8a7db4c3208057f04d6af9f28c7b1e542e899343 (patch) | |
tree | cf10e422e4cef56c6b5048c785aa9349b821672a /cmake | |
parent | 394be4f1d53b2c246cc7b5c429c3b83ebb64da1c (diff) | |
download | mariadb-git-8a7db4c3208057f04d6af9f28c7b1e542e899343.tar.gz |
Bug#28200422 USE CTAGS RATHER THAN ETAGS FOR GENERATING TAGS FILE
Switch to Exuberant Ctags when generating TAGS, since it is much
better at parsing modern C++
Change-Id: I9652012708df7e7edf93161097a547f60fb0cf79
(cherry picked from commit 125b2804fbbb8662632f761f39aeef0a7f9cebb3)
Diffstat (limited to 'cmake')
-rw-r--r-- | cmake/tags.cmake | 35 |
1 files changed, 26 insertions, 9 deletions
diff --git a/cmake/tags.cmake b/cmake/tags.cmake index 07c1411a1d6..fdbe61694a3 100644 --- a/cmake/tags.cmake +++ b/cmake/tags.cmake @@ -1,4 +1,4 @@ -# Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2010, 2018, Oracle and/or its affiliates. All rights reserved. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -15,12 +15,29 @@ # Generate tag files IF(UNIX) - ADD_CUSTOM_TARGET (tags - COMMAND support-files/build-tags - WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} - ) - ADD_CUSTOM_TARGET (ctags - COMMAND ctags -R -f CTAGS - WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} - ) + FIND_PROGRAM(CTAGS_EXECUTABLE ctags) + IF(NOT CTAGS_EXECUTABLE) + RETURN() + ENDIF() + EXEC_PROGRAM(${CTAGS_EXECUTABLE} ARGS --version OUTPUT_VARIABLE CTAGS_VERSION) + + IF(CTAGS_VERSION MATCHES "Exuberant") + ADD_CUSTOM_TARGET(tags + COMMAND support-files/build-tags + WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} + ) + ADD_CUSTOM_TARGET(ctags + COMMAND support-files/build-tags ctags + WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} + ) + ELSE() + ADD_CUSTOM_TARGET (tags + COMMAND exit 1 + COMMENT "Please install Exuberant Ctags" + ) + ADD_CUSTOM_TARGET (ctags + COMMAND exit 1 + COMMENT "Please install Exuberant Ctags" + ) + ENDIF() ENDIF() |