diff --git a/src/plugins/cmakeprojectmanager/cmakeproject.cpp b/src/plugins/cmakeprojectmanager/cmakeproject.cpp index 70862762e64..1658e22807e 100644 --- a/src/plugins/cmakeprojectmanager/cmakeproject.cpp +++ b/src/plugins/cmakeprojectmanager/cmakeproject.cpp @@ -342,11 +342,6 @@ bool CMakeProject::parseCMakeLists() part->displayName = displayName(); part->projectFile = projectFilePath(); - part->evaluateToolchain(tc, - cxxflags, - cxxflags, - SysRootKitInformation::sysRoot(k)); - // This explicitly adds -I. to the include paths part->includePaths += projectDirectory(); @@ -371,6 +366,11 @@ bool CMakeProject::parseCMakeLists() foreach (const QString &file, m_files) adder.maybeAdd(file); + part->evaluateToolchain(tc, + cxxflags, + cxxflags, + SysRootKitInformation::sysRoot(k)); + pinfo.appendProjectPart(part); m_codeModelFuture.cancel(); m_codeModelFuture = modelmanager->updateProjectInfo(pinfo);