CMake build: Check minimum Qt version

Change-Id: I81244c2480d647a2cf48885b2a125a02b11767b4
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
This commit is contained in:
Eike Ziller
2020-09-03 13:36:44 +02:00
parent 9c09d82251
commit 0ceb9f487c
3 changed files with 6 additions and 4 deletions

View File

@@ -7,6 +7,7 @@ include(FeatureSummary)
include(QtCreatorIDEBranding) include(QtCreatorIDEBranding)
include(QtCreatorTranslations) include(QtCreatorTranslations)
include(QtCreatorDocumentation) include(QtCreatorDocumentation)
include(QtCreatorAPI)
set(IDE_REVISION FALSE CACHE BOOL "Marks the presence of IDE revision string.") set(IDE_REVISION FALSE CACHE BOOL "Marks the presence of IDE revision string.")
set(IDE_REVISION_STR "" CACHE STRING "The IDE revision string.") set(IDE_REVISION_STR "" CACHE STRING "The IDE revision string.")
@@ -39,6 +40,7 @@ if (WITH_TESTS)
endif() endif()
find_package(Qt5 find_package(Qt5
${IDE_QT_VERSION_MIN}
COMPONENTS Concurrent Core Gui Network PrintSupport Qml Quick COMPONENTS Concurrent Core Gui Network PrintSupport Qml Quick
QuickWidgets Sql Widgets Xml ${QT_TEST_COMPONENT} QuickWidgets Sql Widgets Xml ${QT_TEST_COMPONENT}
REQUIRED REQUIRED
@@ -85,8 +87,6 @@ if (APPLE)
find_library(FWWebKit WebKit) find_library(FWWebKit WebKit)
endif() endif()
include(QtCreatorAPI)
if (WITH_TESTS) if (WITH_TESTS)
enable_testing() enable_testing()
endif() endif()

View File

@@ -22,9 +22,9 @@ if (Qt5_FIND_COMPONENTS)
endif() endif()
endif() endif()
find_package(Qt6 CONFIG COMPONENTS Core QUIET) find_package(Qt6 ${Qt5_FIND_VERSION} CONFIG COMPONENTS Core QUIET)
if (NOT Qt6_FOUND) 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 # Remove Qt6 from the not found packages in Qt5 mode
get_property(not_found_packages GLOBAL PROPERTY "PACKAGES_NOT_FOUND") get_property(not_found_packages GLOBAL PROPERTY "PACKAGES_NOT_FOUND")

View File

@@ -3,6 +3,8 @@ if(QT_CREATOR_API_DEFINED)
endif() endif()
set(QT_CREATOR_API_DEFINED TRUE) set(QT_CREATOR_API_DEFINED TRUE)
set(IDE_QT_VERSION_MIN "5.14.0")
include(${CMAKE_CURRENT_LIST_DIR}/QtCreatorAPIInternal.cmake) 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). set(IDE_APP_PATH "${_IDE_APP_PATH}") # The target path of the IDE application (relative to CMAKE_INSTALL_PREFIX).