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

no code model for cmake interface libraries with sources

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • Not Evaluated
    • None
    • Qt Creator 10.0.0-beta2
    • None

    Description

      cmake's INTERFACE libraries nowadays can include headers, which will then be used to populate IDE projects. this works like charm in qtcreator and is a great quality of life improvement.
      however there is a small issue when it comes to the code model for these headers: when opening a header, there is not parse context attached

      see attached project

      cmake_minimum_required(VERSION 3.25)
      project(test VERSION 0.1.0 LANGUAGES CXX C)
      add_library(lib INTERFACE include/lib/a.h include/lib/b.h)
      target_include_directories(lib INTERFACE include)
      add_executable(x main.cpp)
      #target_link_libraries(x lib)
      

      qtcreator creates a "project" target for the interface library `lib`, that contains `lib/a.h` and `lib/b.h` (which is expected), but according to the code model, they are not part of any project.

      expected behaviour: a.h/b.h are parsed in the (interface) context of `lib`

      this might be a duplicate of QTCREATORBUG-27764

      Attachments

        Activity

          People

            cadam Cristian Adam
            timblechmann tim blechmann
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: