summaryrefslogtreecommitdiffstats
path: root/Tests/QtAutogen
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2015-04-16 17:54:54 (GMT)
committerBrad King <brad.king@kitware.com>2015-04-16 19:06:31 (GMT)
commit3f7c7c65968b6d04babd261dab952ee40e0c9ca9 (patch)
tree777d1e7c795c9e028b5baff964f8dd7ae7a1acb4 /Tests/QtAutogen
parent26b5cc5e79320dd73e93e117fffd0d4554e89dbc (diff)
downloadCMake-3f7c7c65968b6d04babd261dab952ee40e0c9ca9.zip
CMake-3f7c7c65968b6d04babd261dab952ee40e0c9ca9.tar.gz
CMake-3f7c7c65968b6d04babd261dab952ee40e0c9ca9.tar.bz2
Tests/QtAutogen: Help Qt5Autogen test find Qt5 on Windows
Set CMAKE_PREFIX_PATH to tell find_package(Qt5) where to look.
Diffstat (limited to 'Tests/QtAutogen')
-rw-r--r--Tests/QtAutogen/CMakeLists.txt8
1 files changed, 8 insertions, 0 deletions
diff --git a/Tests/QtAutogen/CMakeLists.txt b/Tests/QtAutogen/CMakeLists.txt
index 7b46619..81a70f4 100644
--- a/Tests/QtAutogen/CMakeLists.txt
+++ b/Tests/QtAutogen/CMakeLists.txt
@@ -2,6 +2,13 @@ cmake_minimum_required(VERSION 3.1)
project(QtAutogen)
+# Tell find_package(Qt5) where to find Qt.
+if(QT_QMAKE_EXECUTABLE)
+ get_filename_component(Qt_BIN_DIR "${QT_QMAKE_EXECUTABLE}" PATH)
+ get_filename_component(Qt_PREFIX_DIR "${Qt_BIN_DIR}" PATH)
+ set(CMAKE_PREFIX_PATH ${Qt_PREFIX_DIR})
+endif()
+
if (QT_TEST_VERSION STREQUAL 4)
find_package(Qt4 REQUIRED)
@@ -124,6 +131,7 @@ try_compile(RCC_DEPENDS
"${CMAKE_CURRENT_SOURCE_DIR}/autorcc_depends"
autorcc_depends
CMAKE_FLAGS "-DQT_QMAKE_EXECUTABLE:FILEPATH=${QT_QMAKE_EXECUTABLE}" "-DQT_TEST_VERSION=${QT_TEST_VERSION}"
+ "-DCMAKE_PREFIX_PATH=${Qt_PREFIX_DIR}"
OUTPUT_VARIABLE output
)
if (NOT RCC_DEPENDS)