Fix qt installation
Install Qt into Qt<ver>/<ver>/ directory
install qt.conf
@@ -60,16 +60,25 @@ target = sys.argv[3]
# mac/ios: "ios"
# windows/desktop: "win64_msvc2017_64", "win64_msvc2015_64",
# "win32_msvc2015", "win32_mingw53"
-# */android: "android_x86", "android_armv7"
+# android: "android_x86", "android_armv7"
+
arch = ""
+arch_dir = ""
if len(sys.argv) == 5:
arch = sys.argv[4]
+ if arch.startswith('win'):
+ arch_dir = arch[6:]
+ else:
+ arch_dir = arch
elif os_name == "linux" and target == "desktop":
arch = "gcc_64"
+ arch_dir = arch
elif os_name == "mac" and target == "desktop":
arch = "clang_64"
+ arch_dir = arch
elif os_name == "mac" and target == "ios":
arch = "ios"
+ arch_dir = arch
if arch == "":
print("Please supply a target architecture.")
@@ -109,6 +118,13 @@ if not full_version or not archives:
print("Error while parsing package information!")
exit(1)
+base_dir= os.path.join(os.getcwd(), 'Qt{}'.format(qt_version))
+if not os.path.exists(base_dir):
+ os.mkdir(base_dir)
+elif not os.path.isdir(base_dir):
+ os.unlink(base_dir)
+ os.mkdir(base_dir)
+os.chdir(base_dir)
print("****************************************")
print("Installing {}".format(package_desc))
@@ -118,6 +134,7 @@ print("TARGET: ", target)
print("ARCH: ", arch)
print("Source URL:", archives_url)
print("****************************************")
+print("into: ", base_dir)
for archive in archives:
url = archives_url + full_version + archive
@@ -128,10 +145,15 @@ for archive in archives:
sys.stdout.write("\033[K")
print("Extracting {}...".format(archive), end="\r")
if platform.system() is 'Windows':
- subprocess.run([r'C:\Program Files\7-Zip\7z.exe', 'x', archive])
+ subprocess.run([r'C:\Program Files\7-Zip\7z.exe', 'x', '-aoa', '-y', archive])
else:
- subprocess.run([r'7z', 'x', archive])
+ subprocess.run([r'7z', 'x', '-aoa', '-y', archive])
os.unlink(archive)
+f = open(os.path.join(base_dir, qt_version, arch_dir, 'bin', 'qt.conf'), 'w')
+f.write("[Paths]\n")
+f.write("Prefix=..\n")
+f.close()
+
sys.stdout.write("\033[K")
print("Finished installation")
