From 88972841898fe5d03388b59901b42884f39dda8b Mon Sep 17 00:00:00 2001 From: dt <qtc-committer@nokia.com> Date: Tue, 3 Mar 2009 17:56:03 +0100 Subject: [PATCH] Fixes: Show the CMakeLists.txt file in the navigation widget and completion Task: CMake support Details: No syntax highlighting --- src/plugins/cmakeprojectmanager/cmakeproject.cpp | 10 +++++++--- .../cmakeprojectmanager/cmakeprojectmanager.cpp | 5 ++++- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/src/plugins/cmakeprojectmanager/cmakeproject.cpp b/src/plugins/cmakeprojectmanager/cmakeproject.cpp index d9b20391ada..d3cd433bbde 100644 --- a/src/plugins/cmakeprojectmanager/cmakeproject.cpp +++ b/src/plugins/cmakeprojectmanager/cmakeproject.cpp @@ -111,8 +111,12 @@ void CMakeProject::parseCMakeLists() m_projectName = cbpparser.projectName(); qDebug()<<"Building Tree"; // TODO do a intelligent updating of the tree - buildTree(m_rootNode, cbpparser.fileList()); - foreach (ProjectExplorer::FileNode *fn, cbpparser.fileList()) + + QList<ProjectExplorer::FileNode *> fileList = cbpparser.fileList(); + // Manually add the CMakeLists.txt file + fileList.append(new ProjectExplorer::FileNode(sourceDirectory + "/CMakeLists.txt", ProjectExplorer::ProjectFileType, false)); + buildTree(m_rootNode, fileList); + foreach (ProjectExplorer::FileNode *fn, fileList) m_files.append(fn->path()); m_files.sort(); @@ -208,7 +212,7 @@ void CMakeProject::buildTree(CMakeProjectNode *rootNode, QList<ProjectExplorer:: ProjectExplorer::FolderNode *CMakeProject::findOrCreateFolder(CMakeProjectNode *rootNode, QString directory) { QString relativePath = QDir(QFileInfo(rootNode->path()).path()).relativeFilePath(directory); - QStringList parts = relativePath.split("/"); + QStringList parts = relativePath.split("/", QString::SkipEmptyParts); ProjectExplorer::FolderNode *parent = rootNode; foreach (const QString &part, parts) { // Find folder in subFolders diff --git a/src/plugins/cmakeprojectmanager/cmakeprojectmanager.cpp b/src/plugins/cmakeprojectmanager/cmakeprojectmanager.cpp index 3f70949fbf3..1a8e2fd49a7 100644 --- a/src/plugins/cmakeprojectmanager/cmakeprojectmanager.cpp +++ b/src/plugins/cmakeprojectmanager/cmakeprojectmanager.cpp @@ -110,7 +110,10 @@ QString CMakeManager::createXmlFile(const QStringList &arguments, const QString buildDirectory.mkpath(buildDirectoryPath); QProcess cmake; cmake.setWorkingDirectory(buildDirectoryPath); - cmake.start(cmakeExecutable(), QStringList() << sourceDirectory << arguments << "-GCodeBlocks - Unix Makefiles"); + + QString generator = "-GCodeBlocks - Unix Makefiles"; + cmake.start(cmakeExecutable(), QStringList() << sourceDirectory << arguments << generator); + qDebug()<<cmakeExecutable()<<sourceDirectory << arguments; cmake.waitForFinished(-1); cmake.setProcessChannelMode(QProcess::MergedChannels); -- GitLab