1 # The module defines the following variables:
2 # CTAGS_EXECUTABLE - path to ctags command line client
3 # CTAGS_FOUND - true if the command line client was found
4 # CTAGS_VERSION_STRING - the version of ctags found (since CMake 2.8.8)
6 # find_package( Ctags )
8 # message("ctags found: ${CTAGS_EXECUTABLE}")
11 find_program( CTAGS_EXECUTABLE
13 DOC "ctags executable"
15 mark_as_advanced( CTAGS_EXECUTABLE )
17 if( CTAGS_EXECUTABLE )
18 execute_process(COMMAND ${CTAGS_EXECUTABLE} --version
19 OUTPUT_VARIABLE ctags_version
21 OUTPUT_STRIP_TRAILING_WHITESPACE
24 if( ctags_version MATCHES "^Exuberant Ctags [0-9]" )
25 string( REPLACE "Exuberant Ctags " "" CTAGS_VERSION_STRING "${ctags_version}" )
26 string( REGEX REPLACE ",.*$" "" CTAGS_VERSION_STRING ${CTAGS_VERSION_STRING} )
29 unset( ctags_version )
32 # Handle the QUIETLY and REQUIRED arguments and set CTAGS_FOUND to TRUE if
33 # all listed variables are TRUE
35 include( FindPackageHandleStandardArgs )
36 find_package_handle_standard_args( Ctags
37 REQUIRED_VARS CTAGS_EXECUTABLE
38 VERSION_VAR CTAGS_VERSION_STRING