diff options
author | Volker Krause <vkrause@kde.org> | 2021-11-30 17:01:46 +0100 |
---|---|---|
committer | Christophe Giboudeaux <christophe@krop.fr> | 2021-12-01 07:53:28 +0000 |
commit | 2f2062114c4312f669bd5d101bbd1ec083e4f5a7 (patch) | |
tree | 4b0576fbea092fea2fdf75289435dc6c7f3b120e /modules | |
parent | 53a640542786bd80a54c29062a0047c82d2f1dc3 (diff) | |
download | extra-cmake-modules-2f2062114c4312f669bd5d101bbd1ec083e4f5a7.tar.gz extra-cmake-modules-2f2062114c4312f669bd5d101bbd1ec083e4f5a7.tar.bz2 |
Include QtVersionOption before all Qt5 find_package calls
This doesn't make all these modules actually work with Qt6 yet, but it
prevents them from unconditionally pulling in Qt5 in a Qt6 build.
This is useful in order to even be able to pass a CMake run to the
point one can port, test and debug the rest.
Diffstat (limited to 'modules')
-rw-r--r-- | modules/ECMAddQch.cmake | 3 | ||||
-rw-r--r-- | modules/ECMAddQtDesignerPlugin.cmake | 11 | ||||
-rw-r--r-- | modules/ECMPoQmTools.cmake | 4 | ||||
-rw-r--r-- | modules/ECMQueryQmake.cmake | 3 |
4 files changed, 13 insertions, 8 deletions
diff --git a/modules/ECMAddQch.cmake b/modules/ECMAddQch.cmake index 8ba91768..f494c543 100644 --- a/modules/ECMAddQch.cmake +++ b/modules/ECMAddQch.cmake @@ -257,6 +257,7 @@ Since 5.36.0. #]=======================================================================] include(CMakeParseArguments) +include(${CMAKE_CURRENT_LIST_DIR}/../modules/QtVersionOption.cmake) include(ECMQueryQmake) @@ -279,7 +280,7 @@ function(_ecm_ensure_qt_qch_targets) # Ideally one day Qt CMake Config files provide these if(NOT TARGET Qt5Core_QCH) # get Qt version, if any - find_package(Qt5Core CONFIG QUIET) + find_package(Qt${QT_MAJOR_VERSION}Core CONFIG QUIET) # lookup tag files query_qmake(qt_docs_dir QT_INSTALL_DOCS TRY) find_path(_qtcoreTagsPath qtcore/qtcore.tags diff --git a/modules/ECMAddQtDesignerPlugin.cmake b/modules/ECMAddQtDesignerPlugin.cmake index 7d3dfb69..72dc683f 100644 --- a/modules/ECMAddQtDesignerPlugin.cmake +++ b/modules/ECMAddQtDesignerPlugin.cmake @@ -179,6 +179,7 @@ Since 5.62.0. #]=======================================================================] include(CMakeParseArguments) +include(${CMAKE_CURRENT_LIST_DIR}/QtVersionOption.cmake) # helper method # escapes string for C++ code @@ -442,7 +443,7 @@ macro(ecm_add_qtdesignerplugin target) # Check deps # peek at Qt5Core to learn about the version to decide whether Qt5UiPlugin is enough if(NOT Qt5Core_FOUND) - find_package(Qt5Core QUIET CONFIG) + find_package(Qt${QT_MAJOR_VERSION}Core QUIET CONFIG) endif() if(Qt5Core_VERSION VERSION_LESS "5.5.0") set(_qtdesigner_tobefound TRUE) @@ -454,15 +455,15 @@ macro(ecm_add_qtdesignerplugin target) set(_qtuiplugin_tobefound TRUE) endif() if(NOT Qt5Designer_FOUND AND _qtdesigner_tobefound) - find_package(Qt5Designer QUIET CONFIG) - set_package_properties(Qt5Designer PROPERTIES + find_package(Qt${QT_MAJOR_VERSION}Designer QUIET CONFIG) + set_package_properties(Qt${QT_MAJOR_VERSION}Designer PROPERTIES PURPOSE "Required to build Qt Designer plugins" TYPE REQUIRED ) endif() if(NOT Qt5UiPlugin_FOUND AND _qtuiplugin_tobefound) - find_package(Qt5UiPlugin QUIET CONFIG) - set_package_properties(Qt5UiPlugin PROPERTIES + find_package(Qt${QT_MAJOR_VERSION}UiPlugin QUIET CONFIG) + set_package_properties(Qt${QT_MAJOR_VERSION}UiPlugin PROPERTIES PURPOSE "Required to build Qt Designer plugins" TYPE REQUIRED ) diff --git a/modules/ECMPoQmTools.cmake b/modules/ECMPoQmTools.cmake index 86480b71..bf9efe0e 100644 --- a/modules/ECMPoQmTools.cmake +++ b/modules/ECMPoQmTools.cmake @@ -83,6 +83,8 @@ Since pre-1.0.0. #]=======================================================================] include(CMakeParseArguments) +include(${CMAKE_CURRENT_LIST_DIR}/QtVersionOption.cmake) + # Copied from FindGettext.cmake function(_ecm_qm_get_unique_target_name _name _unique_name) @@ -143,7 +145,7 @@ function(ecm_process_po_files_as_qm lang) endif() # Find lrelease and lconvert - find_package(Qt5LinguistTools CONFIG REQUIRED) + find_package(Qt${QT_MAJOR_VERSION}LinguistTools CONFIG REQUIRED) if(TARGET Qt5::lconvert) set(lconvert_executable Qt5::lconvert) diff --git a/modules/ECMQueryQmake.cmake b/modules/ECMQueryQmake.cmake index 74a6df87..4d7f9543 100644 --- a/modules/ECMQueryQmake.cmake +++ b/modules/ECMQueryQmake.cmake @@ -1,4 +1,5 @@ -find_package(Qt5Core QUIET) +include(${CMAKE_CURRENT_LIST_DIR}/QtVersionOption.cmake) +find_package(Qt${QT_MAJOR_VERSION}Core QUIET) if (Qt5Core_FOUND) set(_qmake_executable_default "qmake-qt5") |