diff options
author | Cristian Adam <cristian.adam@qt.io> | 2023-02-07 18:15:58 +0100 |
---|---|---|
committer | Cristian Adam <cristian.adam@qt.io> | 2023-02-08 16:17:49 +0000 |
commit | a6ccfb09e588f3500a34b6f240350d77d3403a29 (patch) | |
tree | 78f00caca1316e6005dd575fc8d92652c96ead3a /src/plugins/cmakeprojectmanager/cmakeprocess.cpp | |
parent | f5bd33027756e77890677e32a31f6796ca44481d (diff) | |
download | qt-creator-a6ccfb09e588f3500a34b6f240350d77d3403a29.tar.gz |
CMakePM: Copy auto package-manager to ${buildDir}/.qtc/ directory
By copying the ${IDE:ResourcePath}/package-manager to
${buildDir}/.qtc/ the problem with hardcoding paths
to old an Qt Creator version can no longer occur.
This also fixes the issue with remote projects by reffering
to the code residing on the host.
With the above issues fixed, enable "Package manager auto setup"
by default.
Change-Id: Ia49654a3b9059f83886e64d065019b2d55e9299c
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
Diffstat (limited to 'src/plugins/cmakeprojectmanager/cmakeprocess.cpp')
-rw-r--r-- | src/plugins/cmakeprojectmanager/cmakeprocess.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/plugins/cmakeprojectmanager/cmakeprocess.cpp b/src/plugins/cmakeprojectmanager/cmakeprocess.cpp index 3ac06675f1..7a14143a4b 100644 --- a/src/plugins/cmakeprojectmanager/cmakeprocess.cpp +++ b/src/plugins/cmakeprojectmanager/cmakeprocess.cpp @@ -5,7 +5,9 @@ #include "builddirparameters.h" #include "cmakeparser.h" +#include "cmakeprojectconstants.h" #include "cmakeprojectmanagertr.h" +#include "cmakespecificsettings.h" #include <coreplugin/progressmanager/processprogress.h> #include <projectexplorer/buildsystem.h> @@ -87,6 +89,16 @@ void CMakeProcess::run(const BuildDirParameters ¶meters, const QStringList & } } + // Copy the "package-manager" CMake code from the ${IDE:ResourcePath} to the build directory + if (Internal::CMakeSpecificSettings::instance()->packageManagerAutoSetup.value()) { + const FilePath localPackageManagerDir = buildDirectory.pathAppended(Constants::PACKAGE_MANAGER_DIR); + const FilePath idePackageManagerDir = FilePath::fromString( + parameters.expander->expand(QStringLiteral("%{IDE:ResourcePath}/package-manager"))); + + if (!localPackageManagerDir.exists() && idePackageManagerDir.exists()) + idePackageManagerDir.copyRecursively(localPackageManagerDir); + } + const auto parser = new CMakeParser; parser->setSourceDirectory(parameters.sourceDirectory); m_parser.addLineParser(parser); |