forked from qt-creator/qt-creator
CMake: Always list CMakeLists.txt files
Always list CMakeLists.txt files, even if CMake thinks they are part of its own modules. This unbreaks opening the cmake project with a cmake built from those sources. Change-Id: Ia7245aa0fa39854fe228cdff75b2256115545b39 Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
This commit is contained in:
@@ -291,6 +291,7 @@ void ServerModeReader::generateProjectTree(CMakeListsNode *root,
|
|||||||
QList<FileNode *> cmakeFilesBuild;
|
QList<FileNode *> cmakeFilesBuild;
|
||||||
QList<FileNode *> cmakeFilesOther;
|
QList<FileNode *> cmakeFilesOther;
|
||||||
QList<FileNode *> cmakeLists;
|
QList<FileNode *> cmakeLists;
|
||||||
|
|
||||||
foreach (FileNode *fn, m_cmakeInputsFileNodes) {
|
foreach (FileNode *fn, m_cmakeInputsFileNodes) {
|
||||||
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)
|
||||||
@@ -511,11 +512,14 @@ void ServerModeReader::extractCMakeInputsData(const QVariantMap &data)
|
|||||||
const FileName sfn = FileName::fromString(QDir::cleanPath(srcDir.absoluteFilePath(s)));
|
const FileName sfn = FileName::fromString(QDir::cleanPath(srcDir.absoluteFilePath(s)));
|
||||||
const int oldCount = m_cmakeFiles.count();
|
const int oldCount = m_cmakeFiles.count();
|
||||||
m_cmakeFiles.insert(sfn);
|
m_cmakeFiles.insert(sfn);
|
||||||
if (!isCMake && oldCount < m_cmakeFiles.count())
|
if (oldCount < m_cmakeFiles.count() && (!isCMake || sfn.toString().endsWith("/CMakeLists.txt"))) {
|
||||||
|
// Always include CMakeLists.txt files, even when cmake things these are part of its
|
||||||
|
// stuff. This unbreaks cmake binaries running from their own build directory.
|
||||||
m_cmakeInputsFileNodes.append(new FileNode(sfn, FileType::Project, isTemporary));
|
m_cmakeInputsFileNodes.append(new FileNode(sfn, FileType::Project, isTemporary));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void ServerModeReader::extractCacheData(const QVariantMap &data)
|
void ServerModeReader::extractCacheData(const QVariantMap &data)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user