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

Headers in CMake INTERFACE library are sometimes treated as "out of project" files

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Reported
    • Priority: Not Evaluated
    • Resolution: Unresolved
    • Affects Version/s: Qt Creator 7.0.2, Qt Creator 8.0.0
    • Fix Version/s: None
    • Labels:
      None
    • Environment:
      Windows:
      CMake 3.22.1
      MSVC 2022 (Visual C++ Compiler 17.1.32414)
    • Platform/s:
      Windows

      Description

      I have a CMakeLists.txt with the follwing contents:

      file(GLOB_RECURSE HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/include/*.h)
      add_library(awalgo INTERFACE ${HEADERS})
      target_include_directories(awalgo INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}/include)
      

      All files from that library are shown in the Project View, however, when I open some of them in the editor it says "Warning: This file is not part of any project."

      If I replace the GLOB_RECURSE with a explicit list of files - nothing changes for those files.

       

      Steps to reproduce:

      1. git clone git@github.com:absurdworlds/awlib.git
      2. open the project in Qt Creator
      3. configure the project with -DAW_ENABLE_GRAPHICS:BOOL=OFF
      4. open archive/include/aw/archive/archive_base.h
      5. you should see something like this

        Attachments

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

          Activity

            People

            Assignee:
            cadam Cristian Adam
            Reporter:
            hedede hedede
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:

                Gerrit Reviews

                There are no open Gerrit changes