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

[CMake] source files not displayed properly in source group when located in subdirectories

XMLWordPrintable

    • Linux/X11, macOS, Windows
    • e5d9cb377990180dc75b1ec3b209c742e1c01522 (qt-creator/qt-creator/master)

      Assume the following file structure:

      CMakeLists.txt
      src/A/A.cpp
      src/X/X.cpp
      src/main.cpp

      With the following CMakeLists.txt file:

      cmake_minimum_required(VERSION 3.16 FATAL_ERROR)
      project("Test")
      set(SRC_FILES src/A/A.cpp src/X/X.cpp src/main.cpp)
      add_executable(testapp ${SRC_FILES})
      source_group(TREE ${CMAKE_CURRENT_SOURCE_DIR} FILES ${SRC_FILES})

       

      This results in main.cpp not being put into "src" group Instead the full path in the file system is displayed. See screenshot.

       

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

            hunger Tobias Hunger
            tynnyriolut Philip Hartmann
            Votes:
            5 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes