Add hints for where to find packages for projects expected to fail.
authorStephen Kelly <stephen.kelly@kdab.com>
Fri, 10 Aug 2012 09:13:02 +0000 (11:13 +0200)
committerQt by Nokia <qt-info@nokia.com>
Mon, 13 Aug 2012 07:31:16 +0000 (09:31 +0200)
In the CI system, an environment variable is used to convey
the CMAKE_PREFIX_PATH, but that can not be relied upon.

Change-Id: Ie4fbacaac6ae18f95a3b4d1e796a4b4c91a418c4
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
tests/auto/cmake/test_testlib_no_link_gui/CMakeLists.txt
tests/auto/cmake/test_testlib_no_link_widgets/CMakeLists.txt

index f1727eb..29e9e38 100644 (file)
@@ -5,8 +5,12 @@ project(no_link_gui)
 
 set(CMAKE_INCLUDE_CURRENT_DIR ON)
 
-find_package(Qt5Gui REQUIRED)
-find_package(Qt5Test REQUIRED)
+if (EXISTS "${CMAKE_CURRENT_LIST_DIR}/FindPackageHints.cmake")
+    include("${CMAKE_CURRENT_LIST_DIR}/FindPackageHints.cmake")
+endif()
+
+find_package(Qt5Gui REQUIRED HINTS ${Qt5Tests_PREFIX_PATH})
+find_package(Qt5Test REQUIRED HINTS ${Qt5Tests_PREFIX_PATH})
 
 include_directories(
     ${Qt5Gui_INCLUDE_DIRS}
index 8b4311c..05b0dbb 100644 (file)
@@ -5,8 +5,12 @@ project(no_link_widgets)
 
 set(CMAKE_INCLUDE_CURRENT_DIR ON)
 
-find_package(Qt5Widgets REQUIRED)
-find_package(Qt5Test REQUIRED)
+if (EXISTS "${CMAKE_CURRENT_LIST_DIR}/FindPackageHints.cmake")
+    include("${CMAKE_CURRENT_LIST_DIR}/FindPackageHints.cmake")
+endif()
+
+find_package(Qt5Widgets REQUIRED HINTS ${Qt5Tests_PREFIX_PATH})
+find_package(Qt5Test REQUIRED HINTS ${Qt5Tests_PREFIX_PATH})
 
 include_directories(
     ${Qt5Widgets_INCLUDE_DIRS}