Plugin: CppTools::ProjectInfo project sources and include paths
Hello,
I'm writing my first plugin for Qt Creator to integrate PC Lint check into projects. In order to provide Lint with required information I get active project information this way:
Code:
CppTools::CppModelManager* modelManager = CppTools::CppModelManager::instance();
Project* project=SessionManager::startupProject();
CppTools::ProjectInfo info=modelManager->projectInfo(project);
CppTools::ProjectPart::HeaderPaths includePath=info.headerPaths();
const QSet<QString> sourceFiles=info.sourceFiles();
The problem is that if I have conditions in qmake .pro file and some sources and include paths are added only for special configuration, I still get all source files from ProjectInfo, but include paths only for active configuration. Consequently Lint cannot resolve some includes and stops with error. Example application.pro:
Code:
HEADERS += main/file1.h
CONFIG(with_smth) {
HEADERS += dynamic/file2.h
}
SOURCES += main/file1.cpp
CONFIG(with_smth) {
SOURCES += dynamic/file2.cpp
}
INCLUDEPATH += main
CONFIG(with_smth) {
INCLUDEPATH += dynamic
}
In such case I have file1.cpp and file2.cpp, but only ./main in include paths and file2.h cannot be resolved.
Is there anothe way to get project information from Qt Creator internals?
Re: Plugin: CppTools::ProjectInfo project sources and include paths
That sounds like a question that is more likely to get an anwer on the QtCreator development mailing list
http://lists.qt-project.org/mailman/listinfo/qt-creator
Cheers,
_
Re: Plugin: CppTools::ProjectInfo project sources and include paths
Thanks, I've posted it there.