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

The project view shows srcs and headers as flattened list of directories when using source_group(TREE ...)

    XMLWordPrintable

Details

    • Bug
    • Resolution: Duplicate
    • Not Evaluated
    • None
    • Qt Creator 4.11.0-beta1
    • None

    Description

      It seems that qtcreator 4.11 added support for the source_group command of CMake, which is great. However when using source_group(TREE ...) i expected to have a real tree in the projects view. Instead it shows a flattened tree with one entry per inner folder.

       

      For example using

       

      cmake_minimum_required(VERSION 3.15)
      project(folderstructure)
      set(files
        src/a/file_a.cpp
        src/b/file_b.cpp
        src/c/file_c.cpp
        include/a/file_a.h
        include/b/file_b.h
        include/c/file_c.h)
      add_library(l1 SHARED ${files})
      target_include_directories(l1 PUBLIC include)
      source_group(TREE ${CMAKE_CURRENT_SOURCE_DIR} FILES ${files})
      

      I would expect to have (And which is what i had up to qtcreator 4.10)

       

      • l1
        • include
          • a
            • file_a.h
          • b
            • file_b.h
          • c
            • file_c.h
        • src
          • a
            • file_a.cpp
          • b
            • file_b.cpp
          • c
            • file_c.cpp

      In qtcreator 4.11 i get

      • l1 
        • include/a
          • file_a.h
        • include/b
          • file_b.h
        • include/c
          • file_c.h
        • src/a
          • file_a.cpp
        • src/b
          • file_b.cpp
        • src/c
          • file_c.cpp

       Which is IMHO much harder to read, therefore i would like to have again the real tree from the previous version, filled with the information from the source_group(TREE ...) call.

      Additionally when i do not specify source groups at all, all source files and all header files are thrown together into one "Source Files" and one "Header Files" folder where all folder structure is completely lost. If possible i would like projects for which no explicit source groups have been set up to behave as before.

      I hope i did not miss any option to achieve this.

      Attachments

        Issue Links

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

          Activity

            People

              hunger Tobias Hunger
              kaisalm Kai Salm
              Votes:
              12 Vote for this issue
              Watchers:
              14 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes