summaryrefslogtreecommitdiffstats
path: root/Tests/QtAutomoc/CMakeLists.txt
diff options
context:
space:
mode:
Diffstat (limited to 'Tests/QtAutomoc/CMakeLists.txt')
-rw-r--r--Tests/QtAutomoc/CMakeLists.txt23
1 files changed, 21 insertions, 2 deletions
diff --git a/Tests/QtAutomoc/CMakeLists.txt b/Tests/QtAutomoc/CMakeLists.txt
index ebfbb03..49d433f 100644
--- a/Tests/QtAutomoc/CMakeLists.txt
+++ b/Tests/QtAutomoc/CMakeLists.txt
@@ -2,9 +2,28 @@ cmake_minimum_required(VERSION 2.8)
project(QtAutomoc)
-find_package(Qt4 REQUIRED)
+if (QT_TEST_VERSION STREQUAL 4)
+ find_package(Qt4 REQUIRED)
+
+ include(UseQt4)
+
+ set(QT_QTCORE_TARGET Qt4::QtCore)
+else()
+ if (NOT QT_TEST_VERSION STREQUAL 5)
+ message(SEND_ERROR "Invalid Qt version specified.")
+ endif()
+ find_package(Qt5Widgets REQUIRED)
+
+ set(QT_QTCORE_TARGET Qt5::Core)
+
+ include_directories(${Qt5Widgets_INCLUDE_DIRS})
+ set(QT_LIBRARIES Qt5::Widgets)
+
+ if(Qt5_POSITION_INDEPENDENT_CODE)
+ set(CMAKE_POSITION_INDEPENDENT_CODE ON)
+ endif()
+endif()
-include(UseQt4)
include_directories(${CMAKE_CURRENT_BINARY_DIR})