]> Creatis software - cpPlugins.git/blob - config/install_ivq_mxe.sh
...
[cpPlugins.git] / config / install_ivq_mxe.sh
1 #!/bin/bash
2
3 ## -- Command line options
4 while [[ "$#" -gt 1 ]]; do
5     key="$1"
6     case $key in
7         -prefix)
8         prefix="$2"
9         shift
10         ;;
11         -cores)
12         cores="$2"
13         shift
14         ;;
15         *)
16         # Do nothing
17         ;;
18     esac
19     shift
20 done
21
22 ## -- Check command line options
23 if [ -z "$prefix" ] ; then
24     (>&2 echo "Usage: $0 -prefix [dir] [-cores [n]]")
25     exit 1
26 fi
27
28 ## -- Complete optional parameters
29 if [ -z "$cores" ] ; then
30     cores="1"
31 fi
32 curr_dir=`pwd`
33
34 ## -- Get mxe
35 mkdir -p $prefix
36 cd $prefix
37 git clone https://github.com/mxe/mxe.git
38
39 ## -- Create settings.mk
40 cd $prefix/mxe
41 echo "MXE_TARGETS := x86_64-w64-mingw32.shared" > settings.mk
42
43 ## -- Compile all
44 make -j$cores -k boost qtbase vtk itk
45
46 ## -- End
47 cd $curr_dir
48
49 ## eof - $RCSfile$