diff --git a/CMakeLists.txt b/CMakeLists.txt index 48770a54831..1282fe62067 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 304c3fc07d3..841e977fbfa 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 4ba26250a3f..bde06c3e476 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).