forked from qt-creator/qt-creator
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>
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user