-
-
Notifications
You must be signed in to change notification settings - Fork 153
/
install-windows-vcpkg.sh
executable file
·46 lines (42 loc) · 1.34 KB
/
install-windows-vcpkg.sh
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
#!/bin/bash
set -xeu
# remove system vcpkg
rm -rf "$VCPKG_INSTALLATION_ROOT"
# install llvm from choco in place of vcpkg to speed things up
choco install -y llvm --version "$CHOCO_LLVM_VERSION"
export VCPKG_ROOT="$HOME/build/vcpkg"
export VCPKG_DISABLE_METRICS=1
if [[ -e "$VCPKG_ROOT" && ! -e "$VCPKG_ROOT/.git" ]]; then
rm -rf "$VCPKG_ROOT"
fi
if [ ! -e "$VCPKG_ROOT" ]; then
git clone https://github.com/Microsoft/vcpkg.git "$VCPKG_ROOT"
fi
pushd "$VCPKG_ROOT"
git fetch --all --prune --tags
git status
git checkout .
git checkout "$VCPKG_VERSION"
./bootstrap-vcpkg.sh -disableMetrics
#./vcpkg integrate install
echo "set(VCPKG_BUILD_TYPE release)" >> triplets/x64-windows.cmake
echo "set(VCPKG_BUILD_TYPE release)" >> triplets/x64-windows-static.cmake
echo "set(VCPKG_BUILD_TYPE release)" >> triplets/x86-windows.cmake
echo "set(VCPKG_BUILD_TYPE release)" >> triplets/community/x64-windows-static-md.cmake
export VCPKG_DEFAULT_TRIPLET=x64-windows
#./vcpkg install llvm # takes very long time
(
set +e
which cmake
cmake --version
if ! ./vcpkg install --clean-after-build --recurse "opencv[contrib,nonfree,ade]"; then
for log in "$VCPKG_ROOT/buildtrees"/**/*out.log; do
echo "=== $log"
cat "$log"
done
exit 1
fi
)
# remove build artifacts to save CI cache space
rm -rf "$VCPKG_ROOT/downloads" "$VCPKG_ROOT/buildtrees" "$VCPKG_ROOT/packages"
popd