Automatically find external dependencies in cmake tests.
Currently the Qt5_MODULE_TEST_DEPENDS variable is maintained individually in each repo. This patch makes that obsolete. Change-Id: I1a72bb4da70b9ace6f79296d6a3fb295eaa999ff Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com> Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
This commit is contained in:
parent
cdca61f09a
commit
97e755945c
@ -31,6 +31,8 @@ isEmpty(CMAKE_VERSION) {
|
||||
isEmpty(VERSION_OK) {
|
||||
message("cmake $$CMAKE_VERSION is too old for this test.")
|
||||
} else {
|
||||
load(cmake_functions)
|
||||
|
||||
CMAKE_BUILD_TYPE = Debug
|
||||
CONFIG(release, debug|release):CMAKE_BUILD_TYPE = Release
|
||||
win32-g++*:CMAKE_GENERATOR = -G \"MinGW Makefiles\"
|
||||
@ -41,9 +43,13 @@ isEmpty(CMAKE_VERSION) {
|
||||
CMAKE_PREFIX_PATH *= $$dirname(d)
|
||||
}
|
||||
|
||||
dependentmodules = $$resolve_depends(CMAKE_QT_MODULES_UNDER_TEST, "QT.")
|
||||
dependentmodules -= $$CMAKE_QT_MODULES_UNDER_TEST
|
||||
dependentmodules = $$cmakeModuleList($$dependentmodules)
|
||||
|
||||
check.commands = \
|
||||
$(MKDIR) $$BUILD_DIR && cd $$BUILD_DIR && \
|
||||
cmake $$_PRO_FILE_PWD_ $$CMAKE_GENERATOR -DCMAKE_BUILD_TYPE=$${CMAKE_BUILD_TYPE} -DCMAKE_PREFIX_PATH=\"$$join(CMAKE_PREFIX_PATH, ;)\" && \
|
||||
cmake $$_PRO_FILE_PWD_ $$CMAKE_GENERATOR -DCMAKE_BUILD_TYPE=$${CMAKE_BUILD_TYPE} -DCMAKE_PREFIX_PATH=\"$$join(CMAKE_PREFIX_PATH, ;)\" -DQt5_MODULE_TEST_DEPENDS=\"$${dependentmodules}\" && \
|
||||
$(TESTRUNNER) ctest --output-on-failure
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user