@@ -206,7 +206,7 @@ def Premake():
206206def InstallAQT ():
207207 global qt_dir
208208 qt_platform = "linux" if "linux" in sys .platform else "windows"
209- qt_dir = os .path .abspath (base_dir + "/Qt/" )
209+ qt_dir = os .path .abspath ("{}/Qt_{}/" . format ( base_dir , qt_platform ) )
210210 qt_list = os .listdir (qt_dir ) if os .path .exists (qt_dir ) else {}
211211 if qt_version not in qt_list :
212212 utils .call ([sys .executable , "-m" , "pip" , "install" , "aqtinstall" ], base_dir )
@@ -220,11 +220,19 @@ def InstallAQT():
220220 if (compiler_name + nodotversion .replace ("." ,"" ) + "_" + compiler_arch ) not in qt_list and "linux" not in sys .platform :
221221 utils .call ([sys .executable , "-m" , "aqt" , "install-tool" , qt_platform , "desktop" , aqt_compiler , "--outputdir" , qt_dir ], base_dir )
222222 if is_aqtcreator and "QtCreator" not in qt_list :
223- utils .call ([sys .executable , "-m" , "aqt" , "install-tool" , qt_platform , "desktop" , "tools_" + aqt_creator , "qt.tools." + aqt_creator , "--outputdir" , qt_dir ], base_dir )
223+ qtcreator_dir = os .path .abspath (qt_dir + "/Tools/QtCreator/" )
224+ utils .call ([sys .executable , "-m" , "aqt" , "install-tool" , qt_platform , "desktop" , "tools_" + aqt_creator , "qt.tools." + aqt_creator , "--outputdir" , qt_dir if "linux" in sys .platform else qtcreator_dir ], base_dir )
224225 if "linux" not in sys .platform :
225226 utils .call ([sys .executable , "-m" , "aqt" , "install-tool" , qt_platform , "desktop" , "tools_" + aqt_creator , "qt.tools.qtcreatorcdbext" , "--outputdir" , qt_dir ], base_dir )
226227
227228
229+ def SetupBuildEnvironment ():
230+ nodotversion = compiler_version
231+ compiler_dir = qt_dir + "/Tools/" + compiler_name + nodotversion .replace ("." ,"" ) + "_" + compiler_arch + "/bin/"
232+ split = [ x for x in os .environ ["PATH" ].split (os .pathsep ) if "mingw" not in x ]
233+ os .environ ["PATH" ] = os .pathsep .join (split ) + os .pathsep + os .pathsep .join ([os .path .abspath (compiler_dir )])
234+
235+
228236def Build ():
229237 cprint ("Build '" + prj_type + "' started..." , 'yellow' , attrs = ['reverse' , 'blink' ])
230238 prj_path = prj_dir + "/" + prj_type + "/" + prj_name + ".pro"
@@ -235,7 +243,7 @@ def Build():
235243 compiler_dir = qt_dir + "/Tools/" + compiler_name + nodotversion .replace ("." ,"" ) + "_" + compiler_arch + "/bin/"
236244 make_path = ("make" if "linux" in sys .platform else (compiler_dir + "mingw32-make" )) + exe_ext
237245 build_final = build_dir + "/" + prj_type + "/bin/"
238- os . environ [ "PATH" ] += os . pathsep + os . pathsep . join ([ compiler_dir ] )
246+ SetupBuildEnvironment ( )
239247
240248 cprint ("Generate makefile from qmake..." , 'yellow' , attrs = ['reverse' , 'blink' ])
241249 if not os .path .exists (build_cache ):
@@ -301,7 +309,8 @@ def OpenCreator():
301309 nodotversion = compiler_version
302310 mingw_dir = qt_dir + "/Tools/" + compiler_name + nodotversion .replace ("." ,"" ) + "_" + compiler_arch + "/bin"
303311 os .environ ["PATH" ] += os .pathsep + os .pathsep .join ([mingw_dir ])
304-
312+
313+ SetupBuildEnvironment ()
305314 utils .call ([CreatorPath , prj_path ], base_dir )
306315
307316
0 commit comments