diff options
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() |