aboutsummaryrefslogtreecommitdiffstats
path: root/CMakeLists.txt
diff options
context:
space:
mode:
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt14
1 files changed, 14 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 4964f28..9b34df3 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -2,6 +2,20 @@
cmake_minimum_required(VERSION 3.15.0)
+execute_process (
+ COMMAND $ENV{CMAKE_PREFIX_PATH}/bin/qmake -query QT_VERSION
+ OUTPUT_STRIP_TRAILING_WHITESPACE
+ OUTPUT_VARIABLE qt_version
+)
+
+string(SUBSTRING ${qt_version} 0 1 qt_major_version)
+if (${qt_major_version} EQUAL 5)
+ message(FATAL_ERROR
+ "You're building TreeView using Qt version ${qt_version} (read "
+ "from CMAKE_PREFIX_PATH/bin/qmake). When using Qt 5, you need to "
+ "build with qmake instead.")
+endif()
+
include(.cmake.conf)
project(QtTreeView
VERSION "${QT_REPO_MODULE_VERSION}"