forked from qt-creator/qt-creator
Merge remote-tracking branch 'origin/4.14'
Change-Id: I8543d87779c0da6a876caa046f6852737c9ae680
This commit is contained in:
@@ -111,7 +111,7 @@ CMakeBuildConfiguration::CMakeBuildConfiguration(Target *target, Utils::Id id)
|
||||
if (oldDir.isEmpty())
|
||||
return newDir;
|
||||
|
||||
if (QDir(oldDir).exists("CMakeCache.txt")) {
|
||||
if (QDir(oldDir).exists("CMakeCache.txt") && !QDir(newDir).exists("CMakeCache.txt")) {
|
||||
if (QMessageBox::information(nullptr,
|
||||
tr("Changing Build Directory"),
|
||||
tr("Change the build directory and start with a "
|
||||
|
||||
@@ -796,14 +796,23 @@ void CMakeBuildSystem::wireUpConnections()
|
||||
setParametersAndRequestParse(BuildDirParameters(cmakeBuildConfiguration()),
|
||||
CMakeBuildSystem::REPARSE_FORCE_CMAKE_RUN);
|
||||
});
|
||||
connect(cmakeBuildConfiguration(), &CMakeBuildConfiguration::buildDirectoryChanged, this, [this]() {
|
||||
// The build directory of our BC has changed:
|
||||
// Run with initial arguments!
|
||||
qCDebug(cmakeBuildSystemLog) << "Requesting parse due to build directory change";
|
||||
setParametersAndRequestParse(BuildDirParameters(cmakeBuildConfiguration()),
|
||||
CMakeBuildSystem::REPARSE_FORCE_INITIAL_CONFIGURATION
|
||||
| CMakeBuildSystem::REPARSE_FORCE_CMAKE_RUN);
|
||||
});
|
||||
connect(cmakeBuildConfiguration(),
|
||||
&CMakeBuildConfiguration::buildDirectoryChanged,
|
||||
this,
|
||||
[this]() {
|
||||
// The build directory of our BC has changed:
|
||||
// Does the directory contain a CMakeCache ? Existing build, just parse
|
||||
// No CMakeCache? Run with initial arguments!
|
||||
qCDebug(cmakeBuildSystemLog) << "Requesting parse due to build directory change";
|
||||
const BuildDirParameters parameters(cmakeBuildConfiguration());
|
||||
const bool hasCMakeCache = QFile::exists(
|
||||
(parameters.buildDirectory / "CMakeCache.txt").toString());
|
||||
const auto options = ReparseParameters(
|
||||
hasCMakeCache
|
||||
? REPARSE_DEFAULT
|
||||
: (REPARSE_FORCE_INITIAL_CONFIGURATION | REPARSE_FORCE_CMAKE_RUN));
|
||||
setParametersAndRequestParse(BuildDirParameters(cmakeBuildConfiguration()), options);
|
||||
});
|
||||
|
||||
connect(project(), &Project::projectFileIsDirty, this, [this]() {
|
||||
if (cmakeBuildConfiguration()->isActive() && !isParsing()) {
|
||||
@@ -811,7 +820,7 @@ void CMakeBuildSystem::wireUpConnections()
|
||||
if (cmake && cmake->isAutoRun()) {
|
||||
qCDebug(cmakeBuildSystemLog) << "Requesting parse due to dirty project file";
|
||||
setParametersAndRequestParse(BuildDirParameters(cmakeBuildConfiguration()),
|
||||
CMakeBuildSystem::REPARSE_DEFAULT);
|
||||
CMakeBuildSystem::REPARSE_FORCE_CMAKE_RUN);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user