Skip to content

Commit

Permalink
win: deploy qt files by hand...
Browse files Browse the repository at this point in the history
  • Loading branch information
Dmnk Freemountainer authored and Dmnk Freemountainer committed Nov 29, 2016
1 parent a2ec3da commit 65f6a0a
Showing 1 changed file with 43 additions and 2 deletions.
45 changes: 43 additions & 2 deletions tools/deploy_win.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,17 @@

PROJECT_PATH="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )/../"
TARGET_APP=$(realpath $1)
TARGET_PATH= $(dirname "$TARGET_APP")
TARGET_PATH=$(dirname $TARGET_APP)

OS="$($PROJECT_PATH/tools/uname.sh -o)"
ARCH="$($PROJECT_PATH/tools/uname.sh -a)"
BIN_PATH="$PROJECT_PATH/tmp/bin-$OS-$ARCH"

QT_LIBS=$(dirname $(which qmake))
DEPLOY_QT_DLLS=( "Widgets" "Svg" "QuickTemplates2" "QuickControls2" "Quick" "Qml" "Network" "Gui" "Core" )
DEPLOY_QT_PLUGINS=( "bearer" "iconengines" "imageformats" "qmltooling" )
DEPLOY_QML_MODULES=( "Qt" "QtQml" "QtQuick" "QtQuick.2" "QtGraphicalEffects" )

DEPLOY_CMD="$BIN_PATH/linuxdeployqt"
NODE_CMD="$BIN_PATH/node.exe"
NPM_CMD="$BIN_PATH/npm"
Expand All @@ -23,4 +28,40 @@ $PRUNE_CMD

popd > /dev/null

windeployqt $TARGET_APP --compiler-runtime --release --qmldir=$PROJECT_PATH/src/qml
#windeployqt $TARGET_APP --compiler-runtime --no-libraries --release --qmldir=$PROJECT_PATH/src/qml

#deploy dlls
for name in "${DEPLOY_QT_DLLS[@]}"
do
echo "$QT_LIBS/Qt5$name.dll"
cp -n "$QT_LIBS/Qt5$name.dll" "$TARGET_PATH/Qt5$name.dll"
done

#deploy plguins
pushd . > /dev/null
shopt -s globstar nullglob
for pl in "${DEPLOY_QT_PLUGINS[@]}"
do
cd "$QT_LIBS/../plugins/$pl"
for f in **/*d.dll; do
name="$pl/${f/d.dll/.dll}"
mkdir -p "$TARGET_PATH/$pl"
cp -n "$QT_LIBS/../plugins/$name" "$TARGET_PATH/$name"
done
done

popd > /dev/null

#deploy qml stuff
pushd . > /dev/null
shopt -s globstar nullglob
for pl in "${DEPLOY_QML_MODULES[@]}"
do
cd "$QT_LIBS/../qml/$pl"
for f in **/*; do
mkdir -p "$(dirname $TARGET_PATH/$pl/$f)"
cp -n "$QT_LIBS/../qml/$pl/$f" "$TARGET_PATH/$pl/$f"
done
done

popd > /dev/null

0 comments on commit 65f6a0a

Please sign in to comment.