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

CMake uses wrong header for switch header/source in not included subfolder

    XMLWordPrintable

Details

    • d341ab6371fb97394865cf9c795f0f486174eb51 (qt-creator/tqtc-qt-creator/master)

    Description

      I have a Cmake project with a seperate folder for sources and headers, and a build script that copies the binaries and headers to a subfolder "dist/ARCHITECTURE/" (for multi-architecture builds).
      This folder is not used for SOURCES, HEADERS or included.

      https://imgur.com/x4ml8pX

      (It is ok that it is listed in <Headers> even though it will and never should be used in my context.)

      However, when I work on Something.cpp and switch to the Header (e.g. using F4) it will (sometimes) switch to the header in "dist/...", which is counterintuitive as it is not even included.

      "Sometimes" means: I think it is related to folder naming and if the files have been opened before, but can not reliably pin it down to when it happens. However, starting QtCreator then opening the project and the cpp file, using F4 switches to the wrong header, while if I open the correct header once, then QtCreator uses the correct header until it is closed (closing the files does not change the behavior)

      https://imgur.com/x4ml8pX

      Attachments

        1. CMakeTest.zip
          2 kB
        2. x4ml8pX.png
          x4ml8pX.png
          28 kB

        Issue Links

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

          Activity

            People

              cadam Cristian Adam
              n00b42 Maximilian Maximilian
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes