-
Notifications
You must be signed in to change notification settings - Fork 465
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to determine what CMake generator to use. Please install or configure a preferred #4005
Comments
@siddjain Do you have your generator installed on the machine? For us to investigate what is going on we'd need more information about your project in order to see what is happening. Thanks |
Hi Greg, all I know is that the day I installed CMake tools, it worked perfectly and the very next day I started to get this error. What is CMake generator? I have following executables on my system:
|
Hi siddjain , you can try these steps and see if it solves your problem : 3- now you have to add ninja to the path to the system environment variables , there are two ways to do this
4- now check if the path was set correctly by running this command "where ninja && ninja --version" , it should print the path and version of ninja 5- now close vs code if it's already open and reopen it |
siddjain, could you please try to fix your issue according to the algovoid's comment? If it still reproduces, please share us a demo project with clear repro steps. Thanks. |
Is there a way to disable the new check? In my case, |
@gg-sr What version of the extension are you operating on ? |
@gcampbell-msft Oops, sorry for not including this information in the first place. I'm on v1.19.49. v1.20.0 (pre-release) appears to have the same problem. v1.18.44 works. Not sure if that makes any difference, but this happens in a devcontainer (I haven't tried it outside of a devcontainer). Diagnostics (note that this occurs both on VS Code 1.92.2 and on 1.93.0): {
"os": "linux",
"vscodeVersion": "1.93.0-insider",
"cmtVersion": "1.19.49",
"configurations": [
{
"folder": "...",
"cmakeVersion": "unknown",
"configured": false,
"generator": "unknown",
"usesPresets": false,
"compilers": {}
}
],
"cpptoolsIntegration": {
"isReady": false,
"hasCodeModel": false,
"activeBuildType": "",
"buildTypesSeen": [],
"requests": [],
"responses": [],
"partialMatches": [],
"targetCount": 0,
"executablesCount": 0,
"librariesCount": 0,
"targets": []
},
"settings": [
{
"communicationMode": "automatic",
"useCMakePresets": "auto",
"configureOnOpen": true
}
]
} {
"os": "linux",
"vscodeVersion": "1.93.0-insider",
"cmtVersion": "1.18.44",
"configurations": [
{
"folder": "...",
"cmakeVersion": "3.28.3",
"configured": true,
"generator": "Ninja",
"usesPresets": false,
"compilers": {
"C": "/nix/store/03xd70qibzg98s6m35kq363il7zrcbm2-clang-wrapper-16.0.6/bin/clang",
"CXX": "/nix/store/03xd70qibzg98s6m35kq363il7zrcbm2-clang-wrapper-16.0.6/bin/clang++"
}
}
],
"cpptoolsIntegration": {
"isReady": false,
"hasCodeModel": false,
"activeBuildType": "",
"buildTypesSeen": [],
"requests": [],
"responses": [],
"partialMatches": [],
"targetCount": 0,
"executablesCount": 0,
"librariesCount": 0,
"targets": []
},
"settings": [
{
"communicationMode": "automatic",
"useCMakePresets": "auto",
"configureOnOpen": false
}
]
} Note that |
@gcampbell-msft I do: |
@gg-sr Based on your diagnostics log, it looks like your |
@gg-sr Oh interesting, so this issue still reproduces when you have I'm currently not able to reproduce that, are you using a kit? Or are you using the "unspecified" kit? |
@gg-sr Are you setting CMAKE_MAKE_PROGRAM to an absolute path? |
@gcampbell-msft Yes, I managed to fix my local installation, but unfortunately I don't know exactly what did it as I did multiple things at the same time: unset The following is still printed on project load (after reloading VS Code), but not when configuring, so configuring / building works again:
Edit: with diagnostics: {
"os": "linux",
"vscodeVersion": "1.93.0-insider",
"cmtVersion": "1.19.49",
"configurations": [
{
"folder": "...",
"cmakeVersion": "3.28.3",
"configured": true,
"generator": "Ninja",
"usesPresets": false,
"compilers": {
"C": "/nix/store/nz8z2b1q8mypm5m4mg9wv33rxwvazl73-clang-wrapper-16.0.6/bin/clang",
"CXX": "/nix/store/nz8z2b1q8mypm5m4mg9wv33rxwvazl73-clang-wrapper-16.0.6/bin/clang++"
}
}
],
"cpptoolsIntegration": {
"isReady": false,
"hasCodeModel": false,
"activeBuildType": "",
"buildTypesSeen": [],
"requests": [],
"responses": [],
"partialMatches": [],
"targetCount": 0,
"executablesCount": 0,
"librariesCount": 0,
"targets": []
},
"settings": [
{
"communicationMode": "automatic",
"useCMakePresets": "auto",
"configureOnOpen": false
}
]
} |
I believe that this PR #4026 will solve your issues. We hope to merge by EOD tomorrow, thanks! |
I encountered a similar issue. CMake would attempt to use MAKE the default generator even if ninja is in the path and listed by {
"version": 2,
"configurePresets": [
{
"name": "RealTime-Debug",
"displayName": "RealTime-Debug",
"generator": "Ninja",
"binaryDir": "${sourceDir}/build/${presetName}",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Debug",
"CMAKE_INSTALL_PREFIX": "${sourceDir}/install/${presetName}",
"CMAKE_TOOLCHAIN_FILE": "$env{AzureSphereDefaultSDKDir}/CMakeFiles/AzureSphereRTCoreToolchain.cmake"
},
"environment": { "BuildAllBuildsAllRoots": "true" },
"vendor": {
"microsoft.com/VisualStudioSettings/CMake/1.0": {
"intelliSenseMode": "linux-gcc-arm"
}
}
},
{
"name": "RealTime-RelWithDebInfo",
"displayName": "RealTime-RelWithDebInfo",
"inherits": "RealTime-Debug",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "RelWithDebInfo"
}
},
{
"name": "RealTime-Release",
"displayName": "RealTime-Release",
"inherits": "RealTime-RelWithDebInfo",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Release"
}
}
]
} I'm using a devcontainer based on Ubuntu and I was able to build manually but not using the extension. |
Could you test with this vsix and let me know if this resolves your issue? |
I'm trying to install and test it using: |
Sure, please re-download the zip as I just updated it, you can download from here: |
I tested it and I can confirm that it's working on my end. |
The fix for this issue will be released in the next hour or so in v1.20.2. |
I am also hitting the same issue (running on RHEL) and can confirm that the most recently linked cmake-tools vsix1 fixes the issue. In my case I set Looking forward to the fix in v1.20.2! Footnotes |
Brief Issue Summary
I installed CMake tools and CMake yesterday and it was working fine (w/ Ninja). Today when I opened VS Code all of a sudden it is giving this error:
I have no idea what is its problem.
CMake Tools Diagnostics
Debug Log
Additional Information
No response
The text was updated successfully, but these errors were encountered: