forked from qt-creator/qt-creator
Squish: Fixed selection of generator for CMake project
The generator must match the mkspec of qmake in PATH. Change-Id: Ibd6d345c202719cdf2a8e8a5e2a5fce470732d5b Reviewed-by: Christian Stenger <christian.stenger@nokia.com>
This commit is contained in:
committed by
Robert Löhning
parent
01d8907ea9
commit
d2f8baad67
@@ -59,9 +59,7 @@ def modifyRunSettingsForHookIntoQtQuickUI(projectName, port):
|
|||||||
currentQtVersion = qtVersionCombo.currentText
|
currentQtVersion = qtVersionCombo.currentText
|
||||||
qmake = getQMakeFromQtVersion(currentQtVersion)
|
qmake = getQMakeFromQtVersion(currentQtVersion)
|
||||||
if qmake != None:
|
if qmake != None:
|
||||||
mkspec = getOutputFromCmdline("%s -query QMAKE_MKSPECS" % qmake).strip()
|
mkspec = __getMkspecFromQmake__(qmake)
|
||||||
mkspec = mkspec + os.sep + "default" + os.sep + "qmake.conf"
|
|
||||||
mkspec = __getMkspecFromQMakeConf__(mkspec)
|
|
||||||
if mkspec != None:
|
if mkspec != None:
|
||||||
qtVer = getOutputFromCmdline("%s -query QT_VERSION" % qmake).strip()
|
qtVer = getOutputFromCmdline("%s -query QT_VERSION" % qmake).strip()
|
||||||
squishPath = getSquishPath(mkspec, qtVer)
|
squishPath = getSquishPath(mkspec, qtVer)
|
||||||
@@ -147,6 +145,11 @@ def __getMkspecFromQMakeConf__(qmakeConf):
|
|||||||
return None
|
return None
|
||||||
return os.path.basename(mkspec)
|
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):
|
def getQMakeFromQtVersion(qtVersion):
|
||||||
invokeMenuItem("Tools", "Options...")
|
invokeMenuItem("Tools", "Options...")
|
||||||
buildAndRun = waitForObject("{type='QModelIndex' text='Build & Run' "
|
buildAndRun = waitForObject("{type='QModelIndex' text='Build & Run' "
|
||||||
|
@@ -23,11 +23,21 @@ def openCmakeProject(projectPath, buildDir):
|
|||||||
"window=':CMake Wizard_CMakeProjectManager::Internal::CMakeOpenProjectWizard'}", buildDir)
|
"window=':CMake Wizard_CMakeProjectManager::Internal::CMakeOpenProjectWizard'}", buildDir)
|
||||||
clickButton(waitForObject(":CMake Wizard.Next_QPushButton", 20000))
|
clickButton(waitForObject(":CMake Wizard.Next_QPushButton", 20000))
|
||||||
generatorCombo = waitForObject(":Generator:_QComboBox")
|
generatorCombo = waitForObject(":Generator:_QComboBox")
|
||||||
index = generatorCombo.findText("MinGW Generator (MinGW from SDK)")
|
mkspec = __getMkspecFromQmake__("qmake")
|
||||||
if index == -1:
|
test.log("Using mkspec '%s'" % mkspec)
|
||||||
index = generatorCombo.findText("NMake Generator (Microsoft Visual C++ Compiler 9.0 (x86))")
|
|
||||||
if index != -1:
|
if "win32-" in mkspec:
|
||||||
generatorCombo.setCurrentIndex(index)
|
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))
|
clickButton(waitForObject(":CMake Wizard.Run CMake_QPushButton", 20000))
|
||||||
try:
|
try:
|
||||||
clickButton(waitForObject(":CMake Wizard.Finish_QPushButton", 60000))
|
clickButton(waitForObject(":CMake Wizard.Finish_QPushButton", 60000))
|
||||||
|
Reference in New Issue
Block a user