diff --git a/src/plugins/qmlprojectmanager/qmlprojectexporter/cmakegenerator.cpp b/src/plugins/qmlprojectmanager/qmlprojectexporter/cmakegenerator.cpp index 064fe16b369..7e5b4e3f6cc 100644 --- a/src/plugins/qmlprojectmanager/qmlprojectexporter/cmakegenerator.cpp +++ b/src/plugins/qmlprojectmanager/qmlprojectexporter/cmakegenerator.cpp @@ -194,6 +194,8 @@ bool CMakeGenerator::checkUri(const QString& uri, const Utils::FilePath &path) c Utils::FilePath relative = path.relativeChildPath(m_root->dir); QList pathComponents = relative.pathView().split('/', Qt::SkipEmptyParts); + if (pathComponents.isEmpty()) + return false; for (const auto& import : buildSystem()->allImports()) { Utils::FilePath importPath = Utils::FilePath::fromUserInput(import);