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

Relative includes (*.pri) don't work when project is open with -client option when path contans native separators on windows

    XMLWordPrintable

Details

    • Windows
    • 59fb0e9c9c (qt-creator/qt-creator/7.0) 59fb0e9c9c (qt-creator/qt-creator/master) 59fb0e9c9c (qt-creator/tqtc-qt-creator/7.0) 59fb0e9c9c (qt-creator/tqtc-qt-creator/master) 59fb0e9c9c (qt-creator/tqtc-qt-creator/qds-3.1)

    Description

      Suppose we have project and subproject with this file structure

      D:\project\config.pri
      D:\project\project.pro
      D:\project\subproject\subproject.pro
      

      And subproject.pro contains relative include

      include(../config.pri)
      

      or

      include($$PWD/../config.pri)
      

      Opening subproject in one of this ways works well

      qtcreator D:\project\subproject\subproject.pro
      qtcreator D:/project/subproject/subproject.pro
      qtcreator -client D:/project/subproject/subproject.pro
      cd D:\project\subproject && qtcreator -client subproject.pro
      

      Everything works and looks nice

      However when you try to open like this

      qtcreator -client D:\project\subproject\subproject.pro
      

      QtCreator shows fullpath instead of basename and doesn't show include since it cannot locate it

      and cannot build project due to "missing" config.pri (error shows that path to include computed incorrectly)

      Debug output shows that QmakeProject() constructor recieves path with native separators but expects unix separators because Utils::FilePath relies on that. I cannot track full path it makes before ending up unclean only in later case, but I can suggest fixing it somewhere along the way, for example in ProjectExplorerPlugin::extensionsInitialized (patch in attachement) or in ProjectExplorerPlugin::openProject or in ProjectExplorerPlugin::openProjects

      Attachments

        1. ok.png
          ok.png
          7 kB
        2. not_ok.png
          not_ok.png
          5 kB
        3. build_error.png
          build_error.png
          4 kB
        4. 0001-force-unix-separators.patch
          1.0 kB

        Activity

          People

            kandeler Christian Kandeler
            mugiseyebrows Stanislav Doronin
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: