deployWindows.sh 3.01 KB
Newer Older
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
#!/bin/bash
if [ -z "$1" ]; then
	echo "The first parameter must be the path to a build folder."
	exit 1
fi
if [[ $1 == *"MinGW_32"* ]];then
	mingw_folder="mingw53_32"
	bit="32"
elif [[ $1 == *"MinGW_64"* ]];then
	mingw_folder="mingw73_64"
	bit="64"
else
	echo "Only MinGW builds are supported."
	exit 2
fi

if [[ $1 == *"Debug"* ]];then
	build_type="debug"
else
	build_type="release"
fi

version_with_underscore=$( echo "$1" | cut -d'_' -f3,4,5 )
qt_version="${version_with_underscore//_/.}"

#copy Lichtsteuerung to new folder
Leander Schulten's avatar
Leander Schulten committed
27 28
target_folder="$1/../deploy-$qt_version-$build_type"
rm -f -r "$target_folder"
29
mkdir -p "$target_folder"
Leander Schulten's avatar
Leander Schulten committed
30 31
settings_file="$target_folder/settings.ini"
rm -f "$settings_file"
32 33 34 35 36 37
cp "$1/$build_type/Lichtsteuerung.exe" "$target_folder/Lichtsteuerung.exe"

#run windeployqt.exe
qt_base_dir="C:/Qt/"
exec_base_dir="$qt_base_dir/$qt_version/$mingw_folder"
echo "Running windeployqt"
Leander Schulten's avatar
Leander Schulten committed
38
result=$(eval "'$exec_base_dir/bin/windeployqt.exe' --qmldir 'src' '$target_folder/Lichtsteuerung.exe'")
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
echo "Finish running windeployqt"

#copy boost libs

if [[ $bit == "32" ]]; then
	if [[ $biuld_type == "debug" ]]; then
		boost_context_lib="libboost_contextd.dll"
		boost_coroutine_lib="libboost_coroutined.dll"
	else
		boost_context_lib="libboost_context.dll"
		boost_coroutine_lib="libboost_coroutine.dll"
	fi
else
	if [[ $biuld_type == "debug" ]]; then
		debug_infix="d-"
	else
		debug_infix=''
	fi
	boost_context_lib="mingw73/libboost_context-mgw73-mt-${debug_infix}x64-1_69.dll"
	boost_coroutine_lib="mingw73/libboost_coroutine-mgw73-mt-${debug_infix}x64-1_69.dll"

fi
cp "src/lib/boost/$boost_context_lib" "$target_folder/"
cp "src/lib/boost/$boost_coroutine_lib" "$target_folder/"

#copy AudioFFT
cp "src/lib/AudioFFT/dll/win${bit}/AudioFFT.dll" "$target_folder"
cp "src/lib/AudioFFT/dll/win${bit}/libfftw3-3.dll" "$target_folder"
cp "src/lib/AudioFFT/dll/win${bit}/libfftw3f-3.dll" "$target_folder"
cp "src/lib/AudioFFT/dll/win${bit}/libfftw3l-3.dll" "$target_folder"

Leander Schulten's avatar
Leander Schulten committed
70
#copy Windows Capture Audio Output and add path to settings.ini
71 72
if [[ $biuld_type == "debug" ]]; then
	cp "src/lib/WindowsSound/dll/Capture_Windows_SoundOutputd-x$bit.dll" "$target_folder"
Leander Schulten's avatar
Leander Schulten committed
73
	echo "audioCaptureFilePath=Capture_Windows_SoundOutputd-x$bit.dll" >> "$settings_file"
74 75
else
	cp "src/lib/WindowsSound/dll/Capture_Windows_SoundOutput-x$bit.dll" "$target_folder"
Leander Schulten's avatar
Leander Schulten committed
76
	echo "audioCaptureFilePath=Capture_Windows_SoundOutput-x$bit.dll" >> "$settings_file"
77 78 79 80 81
fi

#copy QTJSONFile
cp "$1/QTJSONFile.json" "$target_folder"

Leander Schulten's avatar
Leander Schulten committed
82
#copy header files for modules and update settings.ini
83
mkdir -p "$target_folder/modules"
Leander Schulten's avatar
Leander Schulten committed
84 85 86
cp -r "src/programms" "$target_folder/modules/include"
echo "includePath=modules/include" >> "$settings_file"
echo "moduleDirPath=modules" >> "$settings_file"
87 88 89 90 91 92 93

#copy some files that are only needed by the minge53 32 Bit version, because windeployqt make a bad job
if [[ $mingw_folder == "mingw53_32" ]]; then
	cp "$exec_base_dir/bin/libgcc_s_dw2-1.dll" "$target_folder"
	cp "$exec_base_dir/bin/libstdc++-6.dll" "$target_folder"
	cp "$exec_base_dir/bin/libwinpthread-1.dll" "$target_folder"
fi