diff options
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 09dc721201a..55bf2bfca85 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -68,11 +68,24 @@ if(MSVC) add_compile_options(/wd4573) endif() -find_package(Qt5 +find_package(Qt6 ${IDE_QT_VERSION_MIN} COMPONENTS Concurrent Core Gui Network PrintSupport Qml Sql Widgets Xml Core5Compat ${QT_TEST_COMPONENT} REQUIRED ) +# hack for Qbs which still supports Qt5 and Qt6 +if (TARGET Qt6::Core5CompatPrivate) + if (CMAKE_VERSION VERSION_LESS 3.18) + set_property(TARGET Qt6::Core5CompatPrivate PROPERTY IMPORTED_GLOBAL TRUE) + endif() + add_library(Qt6Core5CompatPrivate ALIAS Qt6::Core5CompatPrivate) +endif() +if (TARGET Qt6::Core5Compat) + if (CMAKE_VERSION VERSION_LESS 3.18) + set_property(TARGET Qt6::Core5Compat PROPERTY IMPORTED_GLOBAL TRUE) + endif() + add_library(Qt6Core5Compat ALIAS Qt6::Core5Compat) +endif() # Common intermediate directory for QML modules which are defined via qt_add_qml_module() set(QT_QML_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/qml_modules") @@ -85,8 +98,8 @@ if (MSVC AND QT_FEATURE_static_runtime) set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>") endif() -find_package(Qt5 COMPONENTS LinguistTools QUIET) -find_package(Qt5 COMPONENTS Quick QuickWidgets Designer DesignerComponents Help SerialPort Svg Tools QUIET) +find_package(Qt6 OPTIONAL_COMPONENTS Quick QuickWidgets Designer DesignerComponentsPrivate + Help SerialPort Svg Tools LinguistTools QUIET) find_package(Threads) find_package(Clang QUIET) |