From 7bfb10b4980d15128d47ff64cbe21c246616a4f7 Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Fri, 10 Aug 2012 11:13:02 +0200 Subject: [PATCH] Add hints for where to find packages for projects expected to fail. 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 --- tests/auto/cmake/test_testlib_no_link_gui/CMakeLists.txt | 8 ++++++-- tests/auto/cmake/test_testlib_no_link_widgets/CMakeLists.txt | 8 ++++++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/tests/auto/cmake/test_testlib_no_link_gui/CMakeLists.txt b/tests/auto/cmake/test_testlib_no_link_gui/CMakeLists.txt index f1727eb..29e9e38 100644 --- a/tests/auto/cmake/test_testlib_no_link_gui/CMakeLists.txt +++ b/tests/auto/cmake/test_testlib_no_link_gui/CMakeLists.txt @@ -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} diff --git a/tests/auto/cmake/test_testlib_no_link_widgets/CMakeLists.txt b/tests/auto/cmake/test_testlib_no_link_widgets/CMakeLists.txt index 8b4311c..05b0dbb 100644 --- a/tests/auto/cmake/test_testlib_no_link_widgets/CMakeLists.txt +++ b/tests/auto/cmake/test_testlib_no_link_widgets/CMakeLists.txt @@ -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} -- 2.7.4