Move windeployqt to Qmake

`qmake` is better suited for finding `windeployqt`, since it's in the same
directory as `qmake` on windows.

`qmake` is also better suited for finding the build target
(release/debug) vs third party scripts.

`windeployqt` is being forced to run in `cmd` because the syntax is
different for running executables in powershell, which means
`windeployqt` won't be executed and runtime or package errors will
occur.

With the removal of the windeployqt call the deploy step is no longer
needed for building on Windows, since all previous deploy tasks are now
handle by Qmake.
This commit is contained in:
Vasily
2019-07-30 10:45:28 +02:00
committed by username223
parent 94bbd30890
commit 8e43629bb2
3 changed files with 25 additions and 52 deletions
-46
View File
@@ -81,47 +81,6 @@ def package():
create_batch_file()
def deploy():
"""
Runs windeployqt and copies necessary files.
"""
set_current_activity("DEPLOY")
set_dirs()
say("Testing if all required build environment variables are set:")
QT_LOC = find_qt_path()
say("All required build environment values are set.")
if is_env_var_set(BUILD_DEBUG_VAR_NAME):
COMPILE_MODE = "debug"
say(f"{BUILD_DEBUG_VAR_NAME} defined. Deploying '{COMPILE_MODE}' version.")
else:
COMPILE_MODE = "release"
say(f"{BUILD_DEBUG_VAR_NAME} not defined. Deploying '{COMPILE_MODE}' version.")
say("Adding windeployqt to file.")
add_line_to_run_bat_file("set PATH=%PATH%;" + QT_LOC + ";")
add_line_to_run_bat_file("@ECHO Starting windeployqt:")
#Extremely long line
add_line_to_run_bat_file('"' + "windeployqt" + '"'
+ " --dir " + get_deploy_dir()
+ "\\qtdata --libdir " + get_deploy_dir()
+ " --plugindir " + get_deploy_dir() + "\\qtdata\\plugins --no-system-d3d-compiler --no-opengl-sw --"
+ COMPILE_MODE + " --qmldir " + get_project_dir() + "\\src\\res\\qml\\ " + get_deploy_dir() + "\\AdvancedSettings.exe")
add_error_handling_line_to_bat_file()
add_line_to_run_bat_file("@ECHO windeployqt finished.")
say("windeployqt added to file.")
say("Creating batch file:")
create_batch_file()
say("Batch file created.")
def build():
"""
Runs:
@@ -214,11 +173,6 @@ def build():
if __name__ == "__main__":
if argv[1] == "build":
build()
elif argv[1] == "deploy":
deploy()
elif argv[1] == "package":
package()