Uploaded image for project: 'Qt Creator'
  1. Qt Creator
  2. QTCREATORBUG-3959

Include paths searched in the wrong order for cmake projects

XMLWordPrintable

      foo.h is a header located in my project, but also installed in a standard include path
      such as /usr/local/include
      If I include foo.h in a source file and I hover the #include line the tooltip is "/usr/local/include/foo.h" instead of "/path/to/my/project/foo.h".

      It seems that in src/plugins/cmakeprojectmanager/cmakeproject.cpp around line 290, system header
      paths are added before project header paths to the header paths list. Doing it in the other order
      seems to do the trick.

      However there is another problem, the above fix works when there is only one project opened. When multiple project
      are opened, Qt Creator c++ parser gets all header paths from all projects, and remove the duplicates. The include paths
      list is then like this for example : "/path/to/project1","/path/to/project1/include","/usr/local/include",[other system header paths...],"/path/to/project2".
      This is wrong because in that case system header paths are searched before project2 header paths.
      I guess projects header paths should be separated from system header paths. There is a m_systemIncludePaths data member in CppPreprocessor class, but nothing
      is added to it.

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            dt Daniel Teske
            jbrouault Jean-Baptiste Rouault
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes