CMake build: Qt6 build fixes

Set Qt5_VERSION for version checks (e.g. currently still JavaScript
locator filter).

Export special FindQt5.cmake for external plugins and super-repo builds.

Change-Id: I5edb8b0e8bef1a341cd2ff04a13d0a6ce22f6558
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
This commit is contained in:
Eike Ziller
2020-09-03 16:31:28 +02:00
parent 80054d1971
commit 43ee53c233
2 changed files with 6 additions and 1 deletions

View File

@@ -51,6 +51,7 @@ foreach(comp IN LISTS Qt5_FIND_COMPONENTS)
endforeach()
set(Qt5_FOUND ${Qt6_FOUND})
set(Qt5_VERSION ${Qt6_VERSION})
foreach(tool qmake lrelease moc)
if (TARGET Qt6::${tool} AND NOT TARGET Qt5::${tool})

View File

@@ -35,8 +35,11 @@ install(EXPORT QtCreator
)
file(WRITE ${CMAKE_BINARY_DIR}/cmake/QtCreatorConfig.cmake "
\# add module path for special FindQt5.cmake that considers Qt6 too
list(APPEND CMAKE_MODULE_PATH \${CMAKE_CURRENT_LIST_DIR})
include(CMakeFindDependencyMacro)
find_dependency(Qt5
find_dependency(Qt5 ${IDE_QT_VERSION_MIN}
COMPONENTS Concurrent Core Network PrintSupport Qml Quick QuickWidgets Sql REQUIRED
)
@@ -72,6 +75,7 @@ file(COPY
${PROJECT_SOURCE_DIR}/cmake/QtCreatorDocumentation.cmake
${PROJECT_SOURCE_DIR}/cmake/QtCreatorAPI.cmake
${PROJECT_SOURCE_DIR}/cmake/QtCreatorAPIInternal.cmake
${PROJECT_SOURCE_DIR}/cmake/FindQt5.cmake
DESTINATION ${CMAKE_BINARY_DIR}/cmake
)