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

Single header directory causes incorrect 'showSourceSubFolders' behavior (simple reproducible project attached)

    XMLWordPrintable

Details

    • Linux/X11
    • 423315178 (12.0)

    Description

      This is a simple and buggy project with only one directory.

      # file structure
      Test/
      ├── CMakeLists.txt
      ├── main.c
      └── inc1/
          └── a.h
      
      # project view
      Test/
      ├── a.h  <- no header dir !!
      └── main.c
      

      A project having two or more header directories will be fine.

      # file structure
      Test/
      ├── CMakeLists.txt
      ├── main.c
      ├── inc1/
      │   └── a.h
      └── inc2/
          └── b.h
      
      # project view
      Test/
      ├── main.c
      ├── inc1/
      │   └── a.h
      └── inc2/
          └── b.h
      

      Feel free to use this shell script to create a reproducible project.

      #!/bin/sh
      
      function _gen_fake_files()
      {
          mkdir -p inc1 inc2
          : > main.c
          : > inc1/a.h
          : > inc2/b.h
      }
      
      function _gen_cmake_file()
      {
          cat > CMakeLists.txt << EOF
      cmake_minimum_required(VERSION 2.8)
      
      project(Test)
      
      add_executable(Test
          main.c
          inc1/a.h
          inc2/b.h  # comment out this line to reproduce the bug
      )
      
      target_include_directories(Test PRIVATE
          \${CMAKE_CURRENT_SOURCE_DIR}
      )
      
      EOF
      }
      
      _gen_fake_files
      _gen_cmake_file
      

      Attachments

        For Gerrit Dashboard: QTCREATORBUG-29105
        # Subject Branch Project Status CR V

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes