microsoft / vscode-cmake-tools

CMake integration in Visual Studio Code
https://marketplace.visualstudio.com/items?itemName=vector-of-bool.cmake-tools
MIT License
1.46k stars 449 forks source link

Project Outline Does Not Show Source Group or Headers #3815

Open zoro-io opened 3 months ago

zoro-io commented 3 months ago

Brief Issue Summary

Project Outline seems to show only source files that are added to target_include_directories() but does not show present header files in those folders. It also does not seem to utilize directories or files passed through source_group().

CMake Tools Diagnostics

{
  "os": "win32",
  "vscodeVersion": "1.89.1",
  "cmtVersion": "1.18.41",
  "configurations": [
    {
      "folder": "d:\\dev\\repos\\osb\\isolyze\\project\\isolyze_gui",
      "cmakeVersion": "3.29.3",
      "configured": true,
      "generator": "NMake Makefiles JOM",
      "usesPresets": false,
      "compilers": {
        "C": "C:/Program Files (x86)/Microsoft Visual Studio/2022/BuildTools/VC/Tools/MSVC/14.40.33807/bin/Hostx64/x64/cl.exe",
        "CXX": "C:/Program Files (x86)/Microsoft Visual Studio/2022/BuildTools/VC/Tools/MSVC/14.40.33807/bin/Hostx64/x64/cl.exe"
      }
    }
  ],
  "cpptoolsIntegration": {
    "isReady": true,
    "hasCodeModel": true,
    "activeBuildType": "Debug",
    "buildTypesSeen": [
      "Debug"
    ],
    "requests": [],
    "responses": [],
    "partialMatches": [],
    "targetCount": 3,
    "executablesCount": 1,
    "librariesCount": 0,
    "targets": [
      {
        "name": "ISOlyze_gui",
        "type": "EXECUTABLE"
      },
      {
        "name": "ISOlyze_gui_autogen",
        "type": "UTILITY"
      },
      {
        "name": "ISOlyze_gui_autogen_timestamp_deps",
        "type": "UTILITY"
      }
    ]
  },
  "settings": [
    {
      "communicationMode": "automatic",
      "useCMakePresets": "auto",
      "configureOnOpen": false
    }
  ]
}

Debug Log

*  Executing task: CMake: build 

build task started....
"C:\Program Files\CMake\bin\cmake.EXE" --build d:/dev/repos/osb/isolyze/project/isolyze_gui/build --config Debug --target ISOlyze_gui --
jom: parallel job execution disabled for Makefile
-- Could NOT find WrapVulkanHeaders (missing: Vulkan_INCLUDE_DIR) 
-- Could NOT find WrapVulkanHeaders (missing: Vulkan_INCLUDE_DIR) 
-- Configuring done (0.2s)
-- Generating done (0.0s)
-- Build files have been written to: D:/dev/repos/osb/isolyze/project/isolyze_gui/build
[  0%] Built target ISOlyze_gui_autogen_timestamp_deps
[  3%] Automatic MOC and UIC for target ISOlyze_gui
[  3%] Built target ISOlyze_gui_autogen
[  6%] Building CXX object CMakeFiles/ISOlyze_gui.dir/ISOlyze_gui_autogen/mocs_compilation.cpp.obj
[  9%] Building C object CMakeFiles/ISOlyze_gui.dir/D_/dev/repos/osb/isolyze/src_common/LicenseProtection.c.obj
[ 12%] Building CXX object CMakeFiles/ISOlyze_gui.dir/D_/dev/repos/osb/isolyze/src_common/addresstracker.cpp.obj
[ 15%] Building CXX object CMakeFiles/ISOlyze_gui.dir/D_/dev/repos/osb/isolyze/src_common/transfercollection.cpp.obj
[ 18%] Building CXX object CMakeFiles/ISOlyze_gui.dir/D_/dev/repos/osb/isolyze/3rd/lib/TinyXML-2/tinyxml2.cpp.obj
[ 21%] Building CXX object CMakeFiles/ISOlyze_gui.dir/D_/dev/repos/osb/isolyze/src_common/alivecollection.cpp.obj
mocs_compilation.cpp
[ 25%] Building CXX object CMakeFiles/ISOlyze_gui.dir/D_/dev/repos/osb/isolyze/src_gui/Analyzer.cpp.obj
[ 28%] Building CXX object CMakeFiles/ISOlyze_gui.dir/D_/dev/repos/osb/isolyze/src_gui/AnalysingProcess.cpp.obj
[ 34%] Building CXX object CMakeFiles/ISOlyze_gui.dir/D_/dev/repos/osb/isolyze/src_gui/DataStorage.cpp.obj
[ 37%] Building CXX object CMakeFiles/ISOlyze_gui.dir/D_/dev/repos/osb/isolyze/src_gui/DeviceInfo.cpp.obj
[ 31%] Building CXX object CMakeFiles/ISOlyze_gui.dir/D_/dev/repos/osb/isolyze/src_gui/Credits.cpp.obj
[ 40%] Building CXX object CMakeFiles/ISOlyze_gui.dir/D_/dev/repos/osb/isolyze/src_gui/DashboardContainer.cpp.obj
[ 50%] Building CXX object CMakeFiles/ISOlyze_gui.dir/D_/dev/repos/osb/isolyze/src_gui/Export.cpp.obj
[ 46%] Building CXX object CMakeFiles/ISOlyze_gui.dir/D_/dev/repos/osb/isolyze/src_gui/BusLoadDashboard.cpp.obj
[ 43%] Building CXX object CMakeFiles/ISOlyze_gui.dir/D_/dev/repos/osb/isolyze/src_gui/BusLoadAnalyzer.cpp.obj
[ 53%] Building CXX object CMakeFiles/ISOlyze_gui.dir/D_/dev/repos/osb/isolyze/src_gui/BusLoadStatistics.cpp.obj
LicenseProtection.c
tinyxml2.cpp
[ 59%] Building CXX object CMakeFiles/ISOlyze_gui.dir/D_/dev/repos/osb/isolyze/src_gui/LogFileBrowser.cpp.obj
[ 56%] Building CXX object CMakeFiles/ISOlyze_gui.dir/D_/dev/repos/osb/isolyze/src_gui/Formatting.cpp.obj
addresstracker.cpp
alivecollection.cpp
transfercollection.cpp
[ 62%] Building CXX object CMakeFiles/ISOlyze_gui.dir/D_/dev/repos/osb/isolyze/src_gui/Mapping.cpp.obj
[ 68%] Building CXX object CMakeFiles/ISOlyze_gui.dir/D_/dev/repos/osb/isolyze/src_gui/PlotPicker.cpp.obj
[ 68%] Building CXX object CMakeFiles/ISOlyze_gui.dir/D_/dev/repos/osb/isolyze/src_gui/Plot.cpp.obj
BusLoadStatistics.cpp
Credits.cpp
[ 71%] Building CXX object CMakeFiles/ISOlyze_gui.dir/D_/dev/repos/osb/isolyze/src_gui/PrepareAnalyzing.cpp.obj
DeviceInfo.cpp
[ 75%] Building CXX object CMakeFiles/ISOlyze_gui.dir/D_/dev/repos/osb/isolyze/src_gui/SearchBox.cpp.obj
[ 78%] Building CXX object CMakeFiles/ISOlyze_gui.dir/D_/dev/repos/osb/isolyze/src_gui/SyntaxHighlighter.cpp.obj
Export.cpp
[ 81%] Building CXX object CMakeFiles/ISOlyze_gui.dir/D_/dev/repos/osb/isolyze/src_gui/TabBrowser.cpp.obj
Formatting.cpp
DataStorage.cpp
D:\dev\repos\osb\isolyze\src_gui\DataStorage.cpp(45): warning C4996: 'getenv': This function or variable may be unsafe. Consider using _dupenv_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
[ 87%] Building CXX object CMakeFiles/ISOlyze_gui.dir/D_/dev/repos/osb/isolyze/src_gui/isolyze_cli.cpp.obj
[ 87%] Building CXX object CMakeFiles/ISOlyze_gui.dir/D_/dev/repos/osb/isolyze/src_gui/main.cpp.obj
PlotPicker.cpp
D:\dev\repos\osb\isolyze\src_gui\Plot.h(151): warning C4996: 'QMouseEvent::x': Use position()
D:\dev\repos\osb\isolyze\src_gui\Plot.h(152): warning C4996: 'QMouseEvent::y': Use position()
D:\dev\repos\osb\isolyze\src_gui\PlotPicker.cpp(68): warning C4101: 'e': unreferenced local variable
D:\dev\repos\osb\isolyze\src_gui\PlotPicker.cpp(71): warning C4101: 'e': unreferenced local variable
[ 90%] Building CXX object CMakeFiles/ISOlyze_gui.dir/ISOlyze_gui_autogen/F22MH3WFTX/qrc_ISOlyze_gui.cpp.obj
D:\dev\repos\osb\isolyze\src_gui\Plot.h(151): warning C4996: 'QMouseEvent::x': Use position()
D:\dev\repos\osb\isolyze\src_gui\Plot.h(152): warning C4996: 'QMouseEvent::y': Use position()
DashboardContainer.cpp
Plot.cpp
D:\dev\repos\osb\isolyze\src_gui\Plot.h(151): warning C4996: 'QMouseEvent::x': Use position()
D:\dev\repos\osb\isolyze\src_gui\Plot.h(152): warning C4996: 'QMouseEvent::y': Use position()
qrc_ISOlyze_gui.cpp
AnalysingProcess.cpp
D:\dev\repos\osb\isolyze\src_gui\Plot.h(151): warning C4996: 'QMouseEvent::x': Use position()
D:\dev\repos\osb\isolyze\src_gui\Plot.h(152): warning C4996: 'QMouseEvent::y': Use position()
BusLoadAnalyzer.cpp
D:\dev\repos\osb\isolyze\src_gui\Plot.h(151): warning C4996: 'QMouseEvent::x': Use position()
D:\dev\repos\osb\isolyze\src_gui\Plot.h(152): warning C4996: 'QMouseEvent::y': Use position()
D:\dev\repos\osb\isolyze\src_gui\BusLoadAnalyzer.cpp(27): warning C4129: '.': unrecognized character escape sequence
isolyze_cli.cpp
Mapping.cpp
D:\dev\repos\osb\isolyze\src_gui\Plot.h(151): warning C4996: 'QMouseEvent::x': Use position()
D:\dev\repos\osb\isolyze\src_gui\Plot.h(152): warning C4996: 'QMouseEvent::y': Use position()
D:\dev\repos\osb\isolyze\src_gui\Mapping.cpp(75): warning C4129: '.': unrecognized character escape sequence
D:\dev\repos\osb\isolyze\src_gui\Mapping.cpp(174): warning C4129: '.': unrecognized character escape sequence
D:\dev\repos\osb\isolyze\src_gui\Mapping.cpp(508): warning C4129: '.': unrecognized character escape sequence
LogFileBrowser.cpp
Analyzer.cpp
D:\dev\repos\osb\isolyze\src_gui\Plot.h(151): warning C4996: 'QMouseEvent::x': Use position()
D:\dev\repos\osb\isolyze\src_gui\Plot.h(152): warning C4996: 'QMouseEvent::y': Use position()
BusLoadDashboard.cpp
D:\dev\repos\osb\isolyze\src_gui\Plot.h(151): warning C4996: 'QMouseEvent::x': Use position()
D:\dev\repos\osb\isolyze\src_gui\Plot.h(152): warning C4996: 'QMouseEvent::y': Use position()
PrepareAnalyzing.cpp
SearchBox.cpp
main.cpp
SyntaxHighlighter.cpp
TabBrowser.cpp
D:\dev\repos\osb\isolyze\src_common\functionality_gps.h(1): warning C4828: The file contains a character starting at offset 0x698 that is illegal in the current source character set (codepage 65001).
D:\dev\repos\osb\isolyze\src_common\functionality_gps.h(1): warning C4828: The file contains a character starting at offset 0xa08 that is illegal in the current source character set (codepage 65001).
D:\dev\repos\osb\isolyze\src_common\functionality_gps.h(1): warning C4828: The file contains a character starting at offset 0xa35 that is illegal in the current source character set (codepage 65001).
D:\dev\repos\osb\isolyze\src_common\functionality_gps.h(1): warning C4828: The file contains a character starting at offset 0xb48 that is illegal in the current source character set (codepage 65001).
D:\dev\repos\osb\isolyze\src_common\functionality_gps.h(1): warning C4828: The file contains a character starting at offset 0xb4e that is illegal in the current source character set (codepage 65001).
D:\dev\repos\osb\isolyze\src_common\functionality_gps.h(1): warning C4828: The file contains a character starting at offset 0xb6a that is illegal in the current source character set (codepage 65001).
D:\dev\repos\osb\isolyze\src_common\functionality_gps.h(1): warning C4828: The file contains a character starting at offset 0x1ec3 that is illegal in the current source character set (codepage 65001).
D:\dev\repos\osb\isolyze\src_common\functionality_gps.h(1): warning C4828: The file contains a character starting at offset 0x1f06 that is illegal in the current source character set (codepage 65001).
D:\dev\repos\osb\isolyze\src_common\functionality_tecu.h(1): warning C4828: The file contains a character starting at offset 0x65b7 that is illegal in the current source character set (codepage 65001).
D:\dev\repos\osb\isolyze\src_common\functionality_tecu.h(1): warning C4828: The file contains a character starting at offset 0x6617 that is illegal in the current source character set (codepage 65001).
D:\dev\repos\osb\isolyze\src_common\functionality_tecu.h(1): warning C4828: The file contains a character starting at offset 0x6aeb that is illegal in the current source character set (codepage 65001).
D:\dev\repos\osb\isolyze\src_common\functionality_tecu.h(1): warning C4828: The file contains a character starting at offset 0x6b23 that is illegal in the current source character set (codepage 65001).
D:\dev\repos\osb\isolyze\src_gui\LogFileBrowser.cpp(125) : warning C4700: uninitialized local variable 'jump_key' used
D:\dev\repos\osb\isolyze\src_common\functionality_vt.h(152): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
D:\dev\repos\osb\isolyze\src_common\gpx_writer.h(12): warning C4996: 'fopen': This function or variable may be unsafe. Consider using fopen_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
D:\dev\repos\osb\isolyze\src_common\parsers.h(236): warning C4477: 'fprintf' : format string '%d' requires an argument of type 'int', but variadic argument 2 has type 'size_t'
D:\dev\repos\osb\isolyze\src_common\parsers.h(236): note: consider using '%zd' in the format string
D:\dev\repos\osb\isolyze\src_gui\main.cpp(33): warning C4996: 'Qt::AA_EnableHighDpiScaling': High-DPI scaling is always enabled. This attribute no longer has any effect.
[ 93%] Linking CXX executable ISOlyze_gui.exe
[100%] Built target ISOlyze_gui
build finished with warning(s).

Additional Information

Building seems to work just fine. The issue lies in being able to see project files in the Project Outline.

v-frankwang commented 3 months ago

@zoro-io Thank you for reporting this issue. Regarding this issue, I am not sure if the following results reproduce the problem you mentioned, if not please provide us with a simple project that can reproduce this issue. We look forward to hearing from you.

ENV: VSCode: 1.90.0 CMake tools: v1.81.41 C/C++: v1.20.5 Result: image

zoro-io commented 3 months ago

This issue seems to only happen when using Qt, actually. I do not experience this with pure C/C++ projects. Using Qt 6.0+ with the CMake Tools extension does cause this issue, though.

v-frankwang commented 3 months ago

@zoro-io Thank you very much for your reply, I'll continue to go ahead and reproduce the issue based on your tips, I'll be the first to update the review with anything, so I hope you'll be patient.