Commit d2f8baad authored by Robert Loehning's avatar Robert Loehning Committed by Robert Löhning
Browse files

Squish: Fixed selection of generator for CMake project



The generator must match the mkspec of qmake in PATH.

Change-Id: Ibd6d345c202719cdf2a8e8a5e2a5fce470732d5b
Reviewed-by: default avatarChristian Stenger <christian.stenger@nokia.com>
parent 01d8907e
......@@ -59,9 +59,7 @@ def modifyRunSettingsForHookIntoQtQuickUI(projectName, port):
currentQtVersion = qtVersionCombo.currentText
qmake = getQMakeFromQtVersion(currentQtVersion)
if qmake != None:
mkspec = getOutputFromCmdline("%s -query QMAKE_MKSPECS" % qmake).strip()
mkspec = mkspec + os.sep + "default" + os.sep + "qmake.conf"
mkspec = __getMkspecFromQMakeConf__(mkspec)
mkspec = __getMkspecFromQmake__(qmake)
if mkspec != None:
qtVer = getOutputFromCmdline("%s -query QT_VERSION" % qmake).strip()
squishPath = getSquishPath(mkspec, qtVer)
......@@ -147,6 +145,11 @@ def __getMkspecFromQMakeConf__(qmakeConf):
return None
return os.path.basename(mkspec)
def __getMkspecFromQmake__(qmakeCall):
QmakeConfPath = getOutputFromCmdline("%s -query QMAKE_MKSPECS" % qmakeCall).strip()
QmakeConfPath = QmakeConfPath + os.sep + "default" + os.sep + "qmake.conf"
return __getMkspecFromQMakeConf__(QmakeConfPath).strip()
def getQMakeFromQtVersion(qtVersion):
invokeMenuItem("Tools", "Options...")
buildAndRun = waitForObject("{type='QModelIndex' text='Build & Run' "
......
......@@ -23,11 +23,21 @@ def openCmakeProject(projectPath, buildDir):
"window=':CMake Wizard_CMakeProjectManager::Internal::CMakeOpenProjectWizard'}", buildDir)
clickButton(waitForObject(":CMake Wizard.Next_QPushButton", 20000))
generatorCombo = waitForObject(":Generator:_QComboBox")
index = generatorCombo.findText("MinGW Generator (MinGW from SDK)")
if index == -1:
index = generatorCombo.findText("NMake Generator (Microsoft Visual C++ Compiler 9.0 (x86))")
if index != -1:
generatorCombo.setCurrentIndex(index)
mkspec = __getMkspecFromQmake__("qmake")
test.log("Using mkspec '%s'" % mkspec)
if "win32-" in mkspec:
generatorName = {"win32-g++" : "MinGW Generator (MinGW from SDK)",
"win32-msvc2008" : "NMake Generator (Microsoft Visual C++ Compiler 9.0 (x86))",
"win32-msvc2010" : "NMake Generator (Microsoft Visual C++ Compiler 10.0 (x86))"}
index = -1
if mkspec in generatorName:
index = generatorCombo.findText(generatorName[mkspec])
if index == -1:
test.warning("No matching CMake generator for mkspec '%s' found." % mkspec)
else:
generatorCombo.setCurrentIndex(index)
clickButton(waitForObject(":CMake Wizard.Run CMake_QPushButton", 20000))
try:
clickButton(waitForObject(":CMake Wizard.Finish_QPushButton", 60000))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment