Different Utilities for CMake Project Building/Documenting/etc
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

34 lines
1.3 KiB

  1. #!/bin/bash
  2. ##
  3. # settings
  4. ##
  5. BROWSER=firefox
  6. ##
  7. # code
  8. ##
  9. EXE_PATH="`readlink -f $0`"
  10. PRJ_PATH="${EXE_PATH%/*/*/*}"
  11. PROJECT_LOWERCASE_NAME=`grep '\<SET *(PROJECT_LOWERCASE_NAME\>' "$PRJ_PATH"/CMakeLists.txt | sed 's~.*"\(.*\)".*~\1~'`
  12. OUT_PATH="$PRJ_PATH/doc/html/$PROJECT_LOWERCASE_NAME"
  13. OUT_INTERNAL_PATH="$PRJ_PATH/doc/html/$PROJECT_LOWERCASE_NAME-internals"
  14. VALA_BASEDIR=`grep -v '\.\.' "$PRJ_PATH"/valadoc_env | grep '^BASEDIR=[-+A-Za-z0-9. ]\+$' | cut -d= -f2`
  15. VALA_PKGS=`grep -v '\.\.' "$PRJ_PATH"/valadoc_env | grep '^PKGS=[-+A-Za-z0-9. ]\+$' | cut -d= -f2 | sed 's~\(^\| \)~ --pkg=~g; s~^ ~~'`
  16. echo "Generating documentation..."
  17. rm -rf "$OUT_PATH"
  18. VALA_BASEDIR=`echo $VALA_BASEDIR | sed "s~\([^ $]\+\)~$PRJ_PATH/\1~g"`
  19. echo VALA_BASEDIR=$VALA_BASEDIR
  20. echo VALA_PKGS=$VALA_PKGS
  21. valadoc --no-protected -o "$OUT_PATH" -b "$VALA_BASEDIR" `find $VALA_BASEDIR -name "*.vapi" -or -name "*.vala"` $VALA_PKGS
  22. [ 0 == $? ] && $BROWSER "$OUT_PATH"/$PROJECT_LOWERCASE_NAME/index.htm &>/dev/null
  23. #echo "Generating internal documentation..."
  24. #rm -rf "$OUT_INTERNAL_PATH"
  25. #valadoc -o "$OUT_INTERNAL_PATH" -b "$PRJ_PATH/$VALA_BASEDIR" `find "$PRJ_PATH/$VALA_BASEDIR" -name "*.vapi" -or -name "*.vala"` $VALA_PKGS --internal
  26. #$BROWSER "$OUT_INTERNAL_PATH"/$PROJECT_LOWERCASE_NAME-internals/index.htm &>/dev/null