generate-tags.sh 534 B

12345678910111213141516171819202122
  1. #!/usr/bin/env bash
  2. if ! which ctags &>/dev/null ; then
  3. echo "Could not find the 'ctags' command !"
  4. exit 1
  5. fi
  6. if ! [ -f indra/CMakeLists.txt ] ; then
  7. echo "This script shall be ran from the sources tree of the Cool VL Viewer !"
  8. exit 1
  9. fi
  10. source_dirs=`grep add_subdirectory indra/CMakeLists.txt | grep -v cmake | sed -e 's:add_subdirectory(:indra/:' -e 's/)//'`
  11. echo "Generating the 'tags' file..."
  12. ctags --languages=C,C++ --recurse $source_dirs
  13. ret=$?
  14. if (( $ret == 0 )) ; then
  15. echo "Done."
  16. else
  17. echo "Failed."
  18. exit $ret
  19. fi