diff --git a/CMakeLists.txt b/CMakeLists.txt index f04b733be..4a80e87bc 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -235,11 +235,18 @@ else() message(FATAL_ERROR "Qt version ${Launcher_QT_VERSION_MAJOR} is not supported") endif() -include(ECMQueryQt) -ecm_query_qt(QT_PLUGINS_DIR QT_INSTALL_PLUGINS) -ecm_query_qt(QT_LIBS_DIR QT_INSTALL_LIBS) -ecm_query_qt(QT_LIBEXECS_DIR QT_INSTALL_LIBEXECS) -ecm_query_qt(QT_DATA_DIR QT_HOST_DATA) +if(Launcher_QT_VERSION_MAJOR EQUAL 5) + include(ECMQueryQt) + ecm_query_qt(QT_PLUGINS_DIR QT_INSTALL_PLUGINS) + ecm_query_qt(QT_LIBS_DIR QT_INSTALL_LIBS) + ecm_query_qt(QT_LIBEXECS_DIR QT_INSTALL_LIBEXECS) + ecm_query_qt(QT_DATA_DIR QT_HOST_DATA) +else() + set(QT_PLUGINS_DIR ${QT${QT_VERSION_MAJOR}_INSTALL_PREFIX}/${QT${QT_VERSION_MAJOR}_INSTALL_PLUGINS}) + set(QT_LIBS_DIR ${QT${QT_VERSION_MAJOR}_INSTALL_PREFIX}/${QT${QT_VERSION_MAJOR}_INSTALL_LIBS}) + set(QT_LIBEXECS_DIR ${QT${QT_VERSION_MAJOR}_INSTALL_PREFIX}/${QT${QT_VERSION_MAJOR}_INSTALL_LIBEXECS}) + set(QT_DATA_DIR ${QT${QT_VERSION_MAJOR}_INSTALL_PREFIX}/${QT${QT_VERSION_MAJOR}_INSTALL_DATA}) +endif() set(QT_MKSPECS_DIR ${QT_DATA_DIR}/mkspecs) # NOTE: Qt 6 already sets this by default