5 if [ ! -d "$1/$2" ]; then
6 echo "INFO: build dir ($1/$2) doesn't exist, created it!"
11 cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=$3 $1
18 if [ -d "$1/$2" ]; then
29 echo "Usage: build.sh <action> <subdir> [config]"
30 echo " action: can be one of the following"
31 echo " build: build this project."
32 echo " rebuild: rebuild this project."
33 echo " clean: clean the previous build."
34 echo " install: install the build result."
35 echo " subdir: the subdir into which the build is done."
36 echo " config: can be Debug or Release. Ignored if the action is 'clean'."
39 function checkparams {
40 if [ "$#" -ne "$(($1+1))" ]; then
41 echo "ERROR: Wrong number of parameters, expected $1 but got $(($#-1))"
48 CURRENT_DIR=$( dirname "$(readlink -f "$0")" )
49 echo "Current script: $CURRENT_DIR"
51 if [ "$#" -lt "1" ]; then
52 echo "ERROR: At least <action> must be specified!"
59 build $CURRENT_DIR $2 $3
63 rebuild $CURRENT_DIR $2 $3
71 echo "ERROR: Not implemented yet!"
74 echo "ERROR: Unknown action '$3'!"