forked from Exiv2/exiv2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbootstrap.mxe
executable file
·67 lines (46 loc) · 1.84 KB
/
bootstrap.mxe
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
#!/bin/bash
# Copyright (c) 2008-2016, Gilles Caulier, <caulier dot gilles at gmail dot com>
#
# Redistribution and use is allowed according to the terms of the BSD license.
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
#
# Arguments : $1 : MXE build root path to MXE bundle dir (dir must be suffixed by .win32 or .win64 depending of MXE target).
# $2 : build type : 'debugfull' to hack (default), 'release' for production, relwithdebinfo for packaging.
# $3 : Cmake extra configure options.
MXE_BUILDROOT=$1
if [[ $MXE_BUILDROOT == *.win32 ]]; then
echo "MXE target : 32 bits shared"
MXE_BUILD_TARGETS="i686-w64-mingw32.shared"
elif [[ $MXE_BUILDROOT == *.win64 ]]; then
echo "MXE target : 64 bits shared"
MXE_BUILD_TARGETS="x86_64-w64-mingw32.shared"
else
echo "Invalid MXE target!"
exit -1
fi
BUILD_TYPE=$2
if [ "$BUILD_TYPE" = "" ]; then
BUILD_TYPE=relwithdebinfo
fi
MXE_INSTALL_PREFIX=${MXE_BUILDROOT}/usr/${MXE_BUILD_TARGETS}/
MXE_TOOLCHAIN=${MXE_INSTALL_PREFIX}/share/cmake/mxe-conf.cmake
OPTIONS=$3
echo "Installing to $MXE_BUILDROOT for target $MXE_BUILD_TARGETS with build mode $BUILD_TYPE and configure options $OPTIONS"
# Pathes rules
ORIG_PATH="$PATH"
export PATH=$MXE_BUILDROOT/usr/bin:$MXE_INSTALL_PREFIX/qt5/bin:$PATH
if [ ! -d "build" ]; then
mkdir build
fi
cd build
${MXE_BUILD_TARGETS}-cmake -G "Unix Makefiles" . \
-DCMAKE_BUILD_TYPE=${BUILD_TYPE} \
-DCMAKE_COLOR_MAKEFILE=ON \
-DCMAKE_INSTALL_PREFIX=${MXE_INSTALL_PREFIX} \
-DCMAKE_BUILD_WITH_INSTALL_RPATH=ON \
-DCMAKE_TOOLCHAIN_FILE=${MXE_TOOLCHAIN} \
${OPTIONS} \
..
CMAKE_VAL_RET=$?
export PATH=$ORIG_PATH
exit $CMAKE_VAL_RET