vscode-cmake-tools
vscode-cmake-tools copied to clipboard
List of targets empty when using ~/... instead of /home/<user>/... as build dir
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.
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
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 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!