]> Creatis software - cpPlugins.git/blob - config/install_mxe.sh
e43c7dde4beed8e3f04af04a0c7597818d32693b
[cpPlugins.git] / config / install_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         -suffix)
12         suffix="$2"
13         shift
14         ;;
15         -cores)
16         cores="$2"
17         shift
18         ;;
19         *)
20         # Do nothing
21         ;;
22     esac
23     shift
24 done
25
26 ## -- Check command line options
27 if [ -z "$prefix" ] ; then
28     (>&2 echo "Usage: $0 -prefix [dir] [-suffix [string]] [-cores [n]]")
29     exit 1
30 fi
31
32 ## -- Complete optional parameters
33 if [ -z "$cores" ] ; then
34     cores="1"
35 fi
36 if [ ! -z "$suffix" ] ; then
37     qt_suffix="-qtlibinfix $suffix"
38 fi
39 curr_dir=`pwd`
40
41 ## -- Get mxe
42 cd $prefix
43 git clone https://github.com/mxe/mxe.git
44
45 ## -- Create settings.mk
46 cd $prefix/mxe
47 echo "MXE_TARGETS := x86_64-w64-mingw32.shared" > settings.mk
48
49 ## -- Compile all
50 make -j$cores -k qtbase vtk itk nsis
51
52 ## -- End
53 cd $curr_dir
54
55 ## eof - $RCSfile$