Look for CMake config files in the same prefixes as mkspecs.
authorStephen Kelly <stephen.kelly@kdab.com>
Fri, 29 Jun 2012 06:18:56 +0000 (08:18 +0200)
committerQt by Nokia <qt-info@nokia.com>
Mon, 2 Jul 2012 23:08:18 +0000 (01:08 +0200)
This will allow tests of modules outside of qtbase to find their
CMake config files.

Change-Id: I68036908d0fd2ec640530b57d0f572d211ef44f0
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
mkspecs/features/ctest_testcase.prf

index f8283a5..c0ed14d 100644 (file)
@@ -31,9 +31,13 @@ isEmpty(CMAKE_VERSION) {
 
             BUILD_DIR = $$replace($$list($$OUT_PWD/build), /, $$QMAKE_DIR_SEP)
 
+            for(d, $$list($$split($$list($$[QMAKE_MKSPECS]), $$DIRLIST_SEPARATOR))) {
+                CMAKE_PREFIX_PATH *= $$dirname($$d)
+            }
+
             check.commands = \
                 $(MKDIR) $$BUILD_DIR && cd $$BUILD_DIR && \
-                cmake $$_PRO_FILE_PWD_ -DCMAKE_BUILD_TYPE=$${CMAKE_BUILD_TYPE} -DCMAKE_PREFIX_PATH=\"$$[QT_INSTALL_PREFIX]\" && \
+                cmake $$_PRO_FILE_PWD_ -DCMAKE_BUILD_TYPE=$${CMAKE_BUILD_TYPE} -DCMAKE_PREFIX_PATH=\"$$join(CMAKE_PREFIX_PATH, ;)\" && \
                 $(TESTRUNNER) ctest --output-on-failure
 
         }