CMake: Check build dir first, then source dir in server mode

The build dir might be contained in the source directory, but not
the other way around. So this should be more reliable.

Change-Id: I2459b249fcc1002aa7f7787231b5699444a4c6bd
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
This commit is contained in:
Tobias Hunger
2017-09-06 12:08:59 +02:00
parent bcad4a1b94
commit 91f36271e2

View File

@@ -294,10 +294,10 @@ void ServerModeReader::generateProjectTree(CMakeProjectNode *root,
const FileName path = fn->filePath(); const FileName path = fn->filePath();
if (path.fileName().compare("CMakeLists.txt", HostOsInfo::fileNameCaseSensitivity()) == 0) if (path.fileName().compare("CMakeLists.txt", HostOsInfo::fileNameCaseSensitivity()) == 0)
cmakeLists.append(fn); cmakeLists.append(fn);
else if (path.isChildOf(m_parameters.sourceDirectory))
cmakeFilesSource.append(fn);
else if (path.isChildOf(m_parameters.buildDirectory)) else if (path.isChildOf(m_parameters.buildDirectory))
cmakeFilesBuild.append(fn); cmakeFilesBuild.append(fn);
else if (path.isChildOf(m_parameters.sourceDirectory))
cmakeFilesSource.append(fn);
else else
cmakeFilesOther.append(fn); cmakeFilesOther.append(fn);
} }