aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Ziller <eike.ziller@qt.io>2020-09-03 13:36:44 +0200
committerEike Ziller <eike.ziller@qt.io>2020-09-03 12:11:34 +0000
commit0ceb9f487c64b06a2298d0cff1186a3c6d0d0001 (patch)
treebd6337e8a4c3cd44eb960efaa344bf54cd28daa4
parent9c09d822514c6f1d7008c6c7457649d3532722f3 (diff)
CMake build: Check minimum Qt version
Change-Id: I81244c2480d647a2cf48885b2a125a02b11767b4 Reviewed-by: Cristian Adam <cristian.adam@qt.io>
-rw-r--r--CMakeLists.txt4
-rw-r--r--cmake/FindQt5.cmake4
-rw-r--r--cmake/QtCreatorAPI.cmake2
3 files changed, 6 insertions, 4 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 48770a5483..1282fe6206 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -7,6 +7,7 @@ include(FeatureSummary)
include(QtCreatorIDEBranding)
include(QtCreatorTranslations)
include(QtCreatorDocumentation)
+include(QtCreatorAPI)
set(IDE_REVISION FALSE CACHE BOOL "Marks the presence of IDE revision string.")
set(IDE_REVISION_STR "" CACHE STRING "The IDE revision string.")
@@ -39,6 +40,7 @@ if (WITH_TESTS)
endif()
find_package(Qt5
+ ${IDE_QT_VERSION_MIN}
COMPONENTS Concurrent Core Gui Network PrintSupport Qml Quick
QuickWidgets Sql Widgets Xml ${QT_TEST_COMPONENT}
REQUIRED
@@ -85,8 +87,6 @@ if (APPLE)
find_library(FWWebKit WebKit)
endif()
-include(QtCreatorAPI)
-
if (WITH_TESTS)
enable_testing()
endif()
diff --git a/cmake/FindQt5.cmake b/cmake/FindQt5.cmake
index 304c3fc07d..841e977fbf 100644
--- a/cmake/FindQt5.cmake
+++ b/cmake/FindQt5.cmake
@@ -22,9 +22,9 @@ if (Qt5_FIND_COMPONENTS)
endif()
endif()
-find_package(Qt6 CONFIG COMPONENTS Core QUIET)
+find_package(Qt6 ${Qt5_FIND_VERSION} CONFIG COMPONENTS Core QUIET)
if (NOT Qt6_FOUND)
- find_package(Qt5 CONFIG ${__arguments} ${Qt5_FIND_COMPONENTS})
+ find_package(Qt5 ${Qt5_FIND_VERSION} CONFIG ${__arguments} ${Qt5_FIND_COMPONENTS})
# Remove Qt6 from the not found packages in Qt5 mode
get_property(not_found_packages GLOBAL PROPERTY "PACKAGES_NOT_FOUND")
diff --git a/cmake/QtCreatorAPI.cmake b/cmake/QtCreatorAPI.cmake
index 4ba26250a3..bde06c3e47 100644
--- a/cmake/QtCreatorAPI.cmake
+++ b/cmake/QtCreatorAPI.cmake
@@ -3,6 +3,8 @@ if(QT_CREATOR_API_DEFINED)
endif()
set(QT_CREATOR_API_DEFINED TRUE)
+set(IDE_QT_VERSION_MIN "5.14.0")
+
include(${CMAKE_CURRENT_LIST_DIR}/QtCreatorAPIInternal.cmake)
set(IDE_APP_PATH "${_IDE_APP_PATH}") # The target path of the IDE application (relative to CMAKE_INSTALL_PREFIX).