From 9b3de8dd70444fc5a742ab6926ed38064c944224 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kai=20K=C3=B6hne?= Date: Tue, 9 Mar 2021 11:29:23 +0100 Subject: [PATCH] Register QT_LIBEXEC_PATH variables Task-number: QTBUG-88791 Change-Id: I6f83836bab624f2281fd1a62970234713074f8a9 Reviewed-by: Eike Ziller --- src/plugins/qtsupport/baseqtversion.cpp | 14 ++++++++++++++ src/plugins/qtsupport/qtsupportplugin.cpp | 18 ++++++++++++++++++ 2 files changed, 32 insertions(+) diff --git a/src/plugins/qtsupport/baseqtversion.cpp b/src/plugins/qtsupport/baseqtversion.cpp index 92802e2e42e..7b3fd99d118 100644 --- a/src/plugins/qtsupport/baseqtversion.cpp +++ b/src/plugins/qtsupport/baseqtversion.cpp @@ -1485,6 +1485,13 @@ BaseQtVersion::createMacroExpander(const std::function return version->hostPrefixPath().toString(); })); + expander->registerVariable("Qt:QT_HOST_LIBEXECS", + QtKitAspect::tr("The installation location of the current Qt " + "version's internal host executable files."), + versionProperty([](const BaseQtVersion *version) { + return version->hostLibexecPath().toString(); + })); + expander->registerVariable( "Qt:QT_INSTALL_HEADERS", QtKitAspect::tr("The installation location of the current Qt version's header files."), @@ -1509,6 +1516,13 @@ BaseQtVersion::createMacroExpander(const std::function QtKitAspect::tr("The installation location of the current Qt version's executable files."), versionProperty([](const BaseQtVersion *version) { return version->binPath().toString(); })); + expander->registerVariable( + "Qt:QT_INSTALL_LIBEXECS", + QtKitAspect::tr( + "The installation location of the current Qt version's internal executable files."), + versionProperty( + [](const BaseQtVersion *version) { return version->libExecPath().toString(); })); + expander ->registerVariable("Qt:QT_INSTALL_PLUGINS", QtKitAspect::tr( diff --git a/src/plugins/qtsupport/qtsupportplugin.cpp b/src/plugins/qtsupport/qtsupportplugin.cpp index af27b738863..464768d9161 100644 --- a/src/plugins/qtsupport/qtsupportplugin.cpp +++ b/src/plugins/qtsupport/qtsupportplugin.cpp @@ -159,6 +159,15 @@ void QtSupportPlugin::extensionsInitialized() return qt ? qt->binPath().toUserOutput() : QString(); }); + expander->registerVariable( + "CurrentDocument:Project:QT_HOST_LIBEXECS", + tr("Full path to the host libexec directory of the Qt version in the active kit " + "of the project containing the current document."), + []() { + const BaseQtVersion *const qt = currentQtVersion(); + return qt ? qt->hostLibexecPath().toUserOutput() : QString(); + }); + static const auto activeQtVersion = []() -> const BaseQtVersion * { ProjectExplorer::Project *project = SessionManager::startupProject(); if (!project || !project->activeTarget()) @@ -185,6 +194,15 @@ void QtSupportPlugin::extensionsInitialized() return qt ? qt->binPath().toUserOutput() : QString(); }); + expander->registerVariable( + "ActiveProject::QT_HOST_LIBEXECS", + tr("Full path to the libexec bin directory of the Qt version in the active kit " + "of the active project."), + []() { + const BaseQtVersion *const qt = activeQtVersion(); + return qt ? qt->hostLibexecPath().toUserOutput() : QString(); + }); + askAboutQtInstallation(); }