This repository has been archived by the owner on Feb 19, 2022. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 82
/
bootstrap.mxe
executable file
·123 lines (92 loc) · 4.15 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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
#!/bin/bash
# Copyright (c) 2008-2019, 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 (default ./project/mxe/build.win32).
# $2 : build type : 'debugfull' to hack (default), 'release' for production, relwithdebinfo for packaging.
# $3 : Cmake extra configure options.
# Halt and catch errors
set -eE
trap 'PREVIOUS_COMMAND=$THIS_COMMAND; THIS_COMMAND=$BASH_COMMAND' DEBUG
trap 'echo "FAILED COMMAND: $PREVIOUS_COMMAND"' ERR
MXE_BUILDROOT=$1
if [[ $MXE_BUILDROOT == "" ]]; then
if [ -d "`pwd`/project/bundles/mxe/build.win32" ]; then
echo "Auto-detected 32 bits shared MXE target"
MXE_BUILD_TARGETS="i686-w64-mingw32.shared"
MXE_BUILDROOT="`pwd`/project/bundles/mxe/build.win32"
elif [ -d "`pwd`/project/bundles/mxe/build.win64" ]; then
echo "Auto-detected 64 bits shared MXE target"
MXE_BUILD_TARGETS="x86_64-w64-mingw32.shared"
MXE_BUILDROOT="`pwd`/project/bundles/mxe/build.win64"
else
echo "Cannot auto-detect MXE target!"
exit -1
fi
elif [[ $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.mxe" ]; then
mkdir build.mxe
fi
if [ -e "./project/mxe/png2ico/png2ico" ]; then
PNG2ICO_PATH="-DPng2Ico_EXECUTABLE=`pwd`/project/mxe/png2ico/png2ico"
fi
cd build.mxe
${MXE_BUILD_TARGETS}-cmake -G "Unix Makefiles" . \
-DMXE_TOOLCHAIN=${MXE_TOOLCHAIN} \
-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} \
-DCMAKE_FIND_PREFIX_PATH=${CMAKE_PREFIX_PATH} \
-DCMAKE_SYSTEM_INCLUDE_PATH=${CMAKE_PREFIX_PATH}/include \
-DCMAKE_INCLUDE_PATH=${CMAKE_PREFIX_PATH}/include \
-DCMAKE_LIBRARY_PATH=${CMAKE_PREFIX_PATH}/lib \
-DZLIB_ROOT=${CMAKE_PREFIX_PATH} \
-DOpenCV_DIR=${MXE_INSTALL_PREFIX}/lib \
-DBUILD_TESTING=ON \
-DDIGIKAMSC_CHECKOUT_PO=OFF \
-DDIGIKAMSC_CHECKOUT_DOC=OFF \
-DDIGIKAMSC_COMPILE_PO=OFF \
-DDIGIKAMSC_COMPILE_DOC=OFF \
-DDIGIKAMSC_COMPILE_DIGIKAM=ON \
-DENABLE_KFILEMETADATASUPPORT=OFF \
-DENABLE_AKONADICONTACTSUPPORT=OFF \
-DENABLE_MYSQLSUPPORT=ON \
-DENABLE_INTERNALMYSQL=ON \
-DENABLE_MEDIAPLAYER=ON \
-DENABLE_DBUS=OFF \
-DENABLE_KIO=OFF \
-DENABLE_APPSTYLES=ON \
-DENABLE_QWEBENGINE=OFF \
-DENABLE_FACESENGINE_DNN=ON \
-DENABLE_DRMINGW=ON \
${PNG2ICO_PATH} \
${OPTIONS} \
-Wno-dev \
..
CMAKE_VAL_RET=$?
export PATH=$ORIG_PATH
exit $CMAKE_VAL_RET