]> Creatis software - FrontAlgorithms.git/blob - config/install_FrontAlgorithms.sh
9ee9844407cda31dc72e4fb31c360ddaeaa68b2a
[FrontAlgorithms.git] / config / install_FrontAlgorithms.sh
1 #!/bin/bash
2
3 ## -- Command line options
4 while [[ "$#" -gt 1 ]]; do
5     key="$1"
6     case $key in
7         -cpPluginsConfig)
8         cpPluginsConfig="$2"
9         shift
10         ;;
11         -cmake)
12         cmake="$2"
13         shift
14         ;;
15         -prefix)
16         prefix="$2"
17         shift
18         ;;
19         -build_dir)
20         build_dir="$2"
21         shift
22         ;;
23         -cores)
24         cores="$2"
25         shift
26         ;;
27         -build_type)
28         build_type="$2"
29         shift
30         ;;
31         *)
32         # Do nothing
33         ;;
34     esac
35     shift
36 done
37
38 ## -- Check command line options
39 if \
40     [ -z "$cpPluginsConfig" ] || \
41     [ -z "$cmake" ] || \
42     [ -z "$prefix" ] || \
43     [ -z "$cores" ] || \
44     [ -z "$build_type" ] || \
45     [ -z "$build_dir" ] ; then
46     (>&2 echo "Usage: $0 -cpPluginsConfig [file] -cmake [file] -prefix [dir] -build_dir [dir] -build_type [Release/Debug] -cores [n]")
47     exit 1
48 fi
49
50 ## -- Current dir
51 curr_dir=`pwd`
52
53 ## -- Configure, build and install Qt5
54 mkdir -p $build_dir/FrontAlgorithms
55 cd $build_dir/FrontAlgorithms
56 $cmake \
57     -DCMAKE_BUILD_TYPE:STRING=$build_type \
58     -DCMAKE_INSTALL_PREFIX:PATH=$prefix \
59     -Dfpa_BUILD_CTArteries:BOOL=ON \
60     -Dfpa_BUILD_CTBronchi:BOOL=ON \
61     -DcpPlugins_DIR:PATH=`dirname $cpPluginsConfig` \
62     $curr_dir/..
63 make -s -j$cores -k
64 make -s -j -k install
65
66 ## -- End
67 cd $curr_dir
68
69 ## eof - $RCSfile$