Skip to content

"ms-vscode.cmake-tools" C/CPP configuration provider unable to find headers from nuget package #2982

Open
@fredemmott

Description

@fredemmott

Brief Issue Summary

The CMake VS_PACKAGE_REFERENCES target property can be used to make C++ nuget packages (such as C++/WinRT, WIL, and the Windows App SDK) available to CMake projects.

This works fine if I use Visual Studio to open the CMake-produced vcxproj and friends, but VS Code is unable to locate these headers, and in turn, this makes intellisense not usable for files including headers from nuget packages.

CMake Tools Diagnostics

{
  "os": "win32",
  "vscodeVersion": "1.74.3",
  "cmtVersion": "1.13.43",
  "configurations": [
    {
      "folder": "c:\\Users\\Fred\\code\\openkneeboard",
      "cmakeVersion": "3.25.1",
      "configured": true,
      "generator": "Visual Studio 17 2022",
      "usesPresets": false,
      "compilers": {}
    }
  ],
  "cpptoolsIntegration": {
    "isReady": true,
    "hasCodeModel": true,
    "activeBuildType": "Debug",
    "buildTypesSeen": [
      "Debug",
      "Release",
      "MinSizeRel",
      "RelWithDebInfo"
    ],
    "requests": [
      "file:///c%3A/Users/Fred/code/openkneeboard/src/app/app-winui3/MainWindow.xaml.cpp"
    ],
    "responses": [
      {
        "uri": "file:///c%3A/Users/Fred/code/openkneeboard/src/app/app-winui3/MainWindow.xaml.cpp",
        "configuration": {
          "includePath": [
            "c:/users/fred/code/openkneeboard/src/app/app-winui3",
            "c:/users/fred/code/openkneeboard/build/third-party/cppwinrtnuget-prefix/src/cppwinrtnuget-build/include",
            "c:/users/fred/code/openkneeboard/src/app/app-common/gameslist/include",
            "c:/users/fred/code/openkneeboard/src/app/app-common/pagesource/include",
            "c:/users/fred/code/openkneeboard/src/app/app-common/tab/include",
            "c:/users/fred/code/openkneeboard/src/app/app-common/tabslist/include",
            "c:/users/fred/code/openkneeboard/src/app/app-common/toolbaritems/include",
            "c:/users/fred/code/openkneeboard/src/app/app-common/uilayers/include",
            "c:/users/fred/code/openkneeboard/src/app/app-common/userinput/include",
            "c:/users/fred/code/openkneeboard/src/app/app-common/include",
            "c:/users/fred/code/openkneeboard/build/third-party/jsonfetch-prefix/include",
            "c:/users/fred/code/openkneeboard/src/lib/include",
            "c:/users/fred/code/openkneeboard/build/src/lib/include",
            "c:/users/fred/code/openkneeboard/src/games/include",
            "c:/users/fred/code/openkneeboard/third-party/out_ptr/include",
            "c:/users/fred/code/openkneeboard/build/third-party/semverbuild-prefix/src/semverbuild/include"
          ],
          "defines": [
            "BUILD_CONFIG=\"Debug\"",
            "DEBUG",
            "DIRECTINPUT_VERSION=0x0800",
            "DISABLE_XAML_GENERATED_MAIN=1",
            "NOMINMAX=1",
            "OPENKNEEBOARD_BREAK=__debugbreak()",
            "OPENKNEEBOARD_JSON_SERIALIZE=1",
            "OPENKNEEBOARD_UNREACHABLE=__assume(false)",
            "UNICODE=1",
            "WIN32_LEAN_AND_MEAN=1",
            "_UNICODE=1"
          ],
          "compilerPath": "c:/program files/microsoft visual studio/2022/community/vc/tools/msvc/14.34.31933/bin/hostx64/x64/cl.exe",
          "compilerArgs": [],
          "compilerFragments": [
            "/DWIN32 /D_WINDOWS /EHsc /Zi /Ob0 /Od /RTC1 -MTd",
            "/EHsc",
            "/await:strict",
            "/FS",
            "/diagnostics:caret",
            "/Zc:__cplusplus",
            "/utf-8",
            "/WX",
            "/wd4996",
            "/wd4250",
            "/wd4297",
            "/FIC:/Users/Fred/code/openkneeboard/build/src/app/app-winui3/CMakeFiles/OpenKneeboard-App-WinUI3.dir/Debug/cmake_pch.hxx",
            "-std:c++20",
            "/YuC:/Users/Fred/code/openkneeboard/build/src/app/app-winui3/CMakeFiles/OpenKneeboard-App-WinUI3.dir/Debug/cmake_pch.hxx /FpC:/Users/Fred/code/openkneeboard/build/src/app/app-winui3/OpenKneeboard-App-WinUI3.dir/Debug/cmake_pch.pch /FIC:/Users/Fred/code/openkneeboard/build/src/app/app-winui3/CMakeFiles/OpenKneeboard-App-WinUI3.dir/Debug/cmake_pch.hxx"
          ]
        }
      }
    ],
    "partialMatches": [],
    "targetCount": 126,
    "executablesCount": 25,
    "librariesCount": 49,
    "targets": []
  },
  "settings": [
    {
      "communicationMode": "automatic",
      "useCMakePresets": "auto",
      "configureOnOpen": true
    }
  ]
}

Debug Log

No response

Additional Information

Example projects:

Metadata

Metadata

Assignees

No one assigned

    Labels

    Feature: cpptools integrationbuga bug in the productinvestigation neededissues needs a developer assigned to it and investigation done in order to implement a fix

    Type

    No type

    Projects

    Status

    Pending Prioritization

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions