diff options
author | Stephen Kelly <stephen.kelly@kdab.com> | 2013-02-25 11:26:53 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-02-25 23:33:16 +0100 |
commit | 97e755945c0a95d4c82ef4b1897226b340bd9e82 (patch) | |
tree | ba940345a95fc04de631572d2facb8081095acc7 | |
parent | cdca61f09ab9f9f443786bebf65bb8c153202f94 (diff) |
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>
-rw-r--r-- | mkspecs/features/ctest_testcase.prf | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/mkspecs/features/ctest_testcase.prf b/mkspecs/features/ctest_testcase.prf index 7f86ca0052..7e841de790 100644 --- a/mkspecs/features/ctest_testcase.prf +++ b/mkspecs/features/ctest_testcase.prf @@ -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 } |