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:
Qt Code:
  1. CppTools::CppModelManager* modelManager = CppTools::CppModelManager::instance();
  2. Project* project=SessionManager::startupProject();
  3. CppTools::ProjectInfo info=modelManager->projectInfo(project);
  4. CppTools::ProjectPart::HeaderPaths includePath=info.headerPaths();
  5. QByteArray defs=info.defines();
  6. const QSet<QString> sourceFiles=info.sourceFiles();
To copy to clipboard, switch view to plain text mode 
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:
Qt Code:
  1. HEADERS += main/file1.h
  2. CONFIG(with_smth) {
  3. HEADERS += dynamic/file2.h
  4. }
  5. SOURCES += main/file1.cpp
  6. CONFIG(with_smth) {
  7. SOURCES += dynamic/file2.cpp
  8. }
  9. INCLUDEPATH += main
  10. CONFIG(with_smth) {
  11. INCLUDEPATH += dynamic
  12. }
To copy to clipboard, switch view to plain text mode 
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?