summaryrefslogtreecommitdiff
path: root/Tests/Qt4And5Automoc
diff options
context:
space:
mode:
authorStephen Kelly <steveire@gmail.com>2014-01-29 16:57:09 +0100
committerStephen Kelly <steveire@gmail.com>2014-01-29 17:02:43 +0100
commit1fc9ecfae63447f9109475c1b1ffb6a2974458d9 (patch)
tree32444c6c60e89313a9af07e8e4ca3ce8c9f9bda9 /Tests/Qt4And5Automoc
parentf7ae1d8ad6d0db2b6656ed77f7de12189badf05c (diff)
downloadcmake-1fc9ecfae63447f9109475c1b1ffb6a2974458d9.tar.gz
FindQt4: Make AUTOMOC work regardless which order Qt 4/5 is found.
Commit 321e348e (QtAutogen: Use Qt 4 IMPORTED targets to find executable locations., 2014-01-24) attempted to fix this problem, but only solved it for a particular ordering of find_package for Qt 4 and Qt 5. Add a test to ensure that it works with both orderings.
Diffstat (limited to 'Tests/Qt4And5Automoc')
-rw-r--r--Tests/Qt4And5Automoc/CMakeLists.txt9
1 files changed, 7 insertions, 2 deletions
diff --git a/Tests/Qt4And5Automoc/CMakeLists.txt b/Tests/Qt4And5Automoc/CMakeLists.txt
index 61d5743662..ad74961d9f 100644
--- a/Tests/Qt4And5Automoc/CMakeLists.txt
+++ b/Tests/Qt4And5Automoc/CMakeLists.txt
@@ -2,8 +2,13 @@ cmake_minimum_required(VERSION 2.8.12)
project(Qt4And5Automoc)
-find_package(Qt4 REQUIRED)
-find_package(Qt5Core REQUIRED)
+if (QT_REVERSE_FIND_ORDER)
+ find_package(Qt5Core REQUIRED)
+ find_package(Qt4 REQUIRED)
+else()
+ find_package(Qt4 REQUIRED)
+ find_package(Qt5Core REQUIRED)
+endif()
set(CMAKE_AUTOMOC ON)
set(CMAKE_INCLUDE_CURRENT_DIR ON)