forked from c-koi/gmic-qt
-
Notifications
You must be signed in to change notification settings - Fork 0
/
bootstrap.vcpkg
executable file
·69 lines (51 loc) · 1.73 KB
/
bootstrap.vcpkg
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
#!/bin/bash
# SPDX-FileCopyrightText: 2008-2024 by Gilles Caulier, <caulier dot gilles at gmail dot com>
#
# SPDX-License-Identifier: BSD-3-Clause
#
# Arguments : $1 : VCPKG install path (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
VCPKG_DIR="/c/vcpkg"
VCPKG_TRIPLET="x64-windows"
INSTALL_DIR=$1
if [[ $INSTALL_DIR == "" ]]; then
INSTALL_DIR="/e/dk/"
fi
BUILD_TYPE=$2
if [[ $BUILD_TYPE == "" ]]; then
BUILD_TYPE=RelWithDebInfo
fi
OPTIONS=$3
echo "Installing to $INSTALL_DIR for target $VCPKG_TRIPLET with build mode $BUILD_TYPE and configure options $OPTIONS"
# Paths rules
ORIG_PATH="$PATH"
export PATH=$PATH:/c/bison:/c/icoutils/bin:$INSTALL_DIR/$VCPKG_TRIPLET/tools/gperf:$INSTALL_DIR/$VCPKG_TRIPLET/tools/python3:$INSTALL_DIR/$VCPKG_TRIPLET/bin
echo "PATH=$PATH"
if [ ! -d "build" ]; then
mkdir build
fi
cd build
cmake .. \
-DCMAKE_TOOLCHAIN_FILE=$VCPKG_DIR/scripts/buildsystems/vcpkg.cmake \
-DVCPKG_TARGET_TRIPLET=$VCPKG_TRIPLET \
-DCMAKE_COLOR_MAKEFILE=ON \
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON \
-DCMAKE_INSTALL_PREFIX=$INSTALL_DIR/$VCPKG_TRIPLET \
-DCMAKE_BUILD_TYPE=$BUILD_TYPE \
-DINSTALL_ROOT=$INSTALL_DIR \
-DENABLE_ASAN=OFF \
-DENABLE_SYSTEM_GMIC=OFF \
-DENABLE_CURL=OFF \
-DGMIC_QT_HOST=digikam \
-DBUILD_WITH_QT6=ON \
-DBUILD_TESTING=ON \
${OPTIONS} \
-Wno-dev
CMAKE_VAL_RET=$?
export PATH=$ORIG_PATH
exit $CMAKE_VAL_RET