forked from qt-creator/qt-creator
CMake build: Improve default qmake for dumper tests
We can do better than just "qmake" and instead take the path to the qmake that the test was compiled with. (Can still be overridden with environment variables.) Change-Id: Icc045d4f96946aeb1f324e6f1334dc9747215f3f Reviewed-by: Cristian Adam <cristian.adam@qt.io> Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
@@ -9,10 +9,14 @@ add_qtc_test(tst_debugger_disassembler
|
|||||||
|
|
||||||
option(WITH_DEBUGGER_DUMPERS "Include tests for debugger pretty printers" ON)
|
option(WITH_DEBUGGER_DUMPERS "Include tests for debugger pretty printers" ON)
|
||||||
if (WITH_DEBUGGER_DUMPERS)
|
if (WITH_DEBUGGER_DUMPERS)
|
||||||
|
get_target_property(qmake_binary Qt5::qmake IMPORTED_LOCATION)
|
||||||
|
|
||||||
add_qtc_test(tst_debugger_dumpers
|
add_qtc_test(tst_debugger_dumpers
|
||||||
TIMEOUT 0
|
TIMEOUT 0
|
||||||
DEPENDS Qt5::Network Utils
|
DEPENDS Qt5::Network Utils
|
||||||
DEFINES DUMPERDIR="${PROJECT_SOURCE_DIR}/share/qtcreator/debugger"
|
DEFINES
|
||||||
|
DUMPERDIR="${PROJECT_SOURCE_DIR}/share/qtcreator/debugger"
|
||||||
|
DEFAULT_QMAKE_BINARY="${qmake_binary}"
|
||||||
INCLUDES
|
INCLUDES
|
||||||
"${DEBUGGERDIR}"
|
"${DEBUGGERDIR}"
|
||||||
SOURCES
|
SOURCES
|
||||||
|
@@ -64,8 +64,10 @@ HEADERS += \
|
|||||||
|
|
||||||
!isEmpty(vcproj) {
|
!isEmpty(vcproj) {
|
||||||
DEFINES += DUMPERDIR=\"$$DUMPERDIR\"
|
DEFINES += DUMPERDIR=\"$$DUMPERDIR\"
|
||||||
|
DEFINES += DEFAULT_QMAKE_BINARY=\"qmake\"
|
||||||
} else {
|
} else {
|
||||||
DEFINES += DUMPERDIR=\\\"$$DUMPERDIR\\\"
|
DEFINES += DUMPERDIR=\\\"$$DUMPERDIR\\\"
|
||||||
|
DEFINES += DEFAULT_QMAKE_BINARY=\\\"qmake\\\"
|
||||||
}
|
}
|
||||||
|
|
||||||
INCLUDEPATH += $$DEBUGGERDIR
|
INCLUDEPATH += $$DEBUGGERDIR
|
||||||
|
@@ -26,6 +26,7 @@ QtcAutotest {
|
|||||||
cpp.defines: base.concat([
|
cpp.defines: base.concat([
|
||||||
'CDBEXT_PATH="' + project.buildDirectory + '\\\\lib"',
|
'CDBEXT_PATH="' + project.buildDirectory + '\\\\lib"',
|
||||||
'DUMPERDIR="' + path + '/../../../share/qtcreator/debugger"',
|
'DUMPERDIR="' + path + '/../../../share/qtcreator/debugger"',
|
||||||
|
'DEFAULT_QMAKE_BINARY="qmake"'
|
||||||
])
|
])
|
||||||
cpp.includePaths: base.concat([project.debuggerDir])
|
cpp.includePaths: base.concat([project.debuggerDir])
|
||||||
}
|
}
|
||||||
|
@@ -1189,7 +1189,7 @@ void tst_Dumpers::initTestCase()
|
|||||||
|
|
||||||
m_qmakeBinary = QDir::fromNativeSeparators(QString::fromLocal8Bit(qgetenv("QTC_QMAKE_PATH_FOR_TEST")));
|
m_qmakeBinary = QDir::fromNativeSeparators(QString::fromLocal8Bit(qgetenv("QTC_QMAKE_PATH_FOR_TEST")));
|
||||||
if (m_qmakeBinary.isEmpty())
|
if (m_qmakeBinary.isEmpty())
|
||||||
m_qmakeBinary = "qmake";
|
m_qmakeBinary = DEFAULT_QMAKE_BINARY;
|
||||||
if (qEnvironmentVariableIntValue("QTC_USE_CMAKE_FOR_TEST"))
|
if (qEnvironmentVariableIntValue("QTC_USE_CMAKE_FOR_TEST"))
|
||||||
m_buildSystem = BuildSystem::CMake;
|
m_buildSystem = BuildSystem::CMake;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user