vscode-cmake-tools icon indicating copy to clipboard operation
vscode-cmake-tools copied to clipboard

List of targets empty when using ~/... instead of /home/<user>/... as build dir

Open haferburg opened this issue 1 year ago • 2 comments

Brief Issue Summary

I just used the CMake: Quick Start to generate the sample project. I had set the Cmake: Build Directory setting to ~/build/${workspaceRootFolderName}/${buildType}, then generated with Ninja. The CMAKE_BUILD_TYPE was set to Debug.

When trying to configure the Build target in the Project status, the selection dropdown is empty.

image

When trying to configure the Debug or Launch target, the dropdown doesn't even appear at all.


Everything works fine when I set the Cmake: Build Directory setting to /home/andreas/build/${workspaceRootFolderName}/${buildType}.

CMake Tools Diagnostics

{
  "os": "linux",
  "vscodeVersion": "1.85.1",
  "cmtVersion": "1.16.32",
  "configurations": [
    {
      "folder": "/home/andreas/src/cmake-quick",
      "cmakeVersion": "3.28.1",
      "configured": true,
      "generator": "Ninja",
      "usesPresets": false,
      "compilers": {}
    }
  ],
  "cpptoolsIntegration": {
    "isReady": true,
    "hasCodeModel": false,
    "activeBuildType": "",
    "buildTypesSeen": [],
    "requests": [],
    "responses": [],
    "partialMatches": [],
    "targetCount": 0,
    "executablesCount": 0,
    "librariesCount": 0,
    "targets": []
  },
  "settings": [
    {
      "communicationMode": "automatic",
      "useCMakePresets": "auto",
      "configureOnOpen": true
    }
  ]
}

Debug Log

No response

Additional Information

No response

haferburg avatar Jan 18 '24 19:01 haferburg

I just realized: Workaround is to use ${userHome}/build/${workspaceRootFolderName}/${buildType}.

But it's still odd that there is no error message during configure. In my humble opinion it should either work or error out.

haferburg avatar Jan 18 '24 19:01 haferburg

@haferburg Thanks for the workaround! In the meantime, I would agree that this scenario should be better handled by the extension. I'll mark this as a bug, and we will place this on the backlog, with the intention to, once we are able to prioritize this, we can reproduce the issue and see what it going on.

Thanks!

gcampbell-msft avatar Jan 19 '24 16:01 gcampbell-msft