This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

VS Code: Unable to determine what CMake generator to use.

When I create a new project from samples in VS Code I get this error
[variant] Loaded new set of variants
[kit] Successfully loaded 9 kits from C:\Users\Andrea\AppData\Local\CMakeTools\cmake-tools-kits.json
[main] Unable to determine what CMake generator to use. Please install or configure a preferred generator, or update settings.json, your Kit configuration or PATH variable. Error: No usable generator found.
[main] Configuring folder: hello_world
[main] Unable to determine what CMake generator to use. Please install or configure a preferred generator, or update settings.json, your Kit configuration or PATH variable. Error: No usable generator found.
How can I fix it?
Parents
  • Help me guys. I've unistalled  completely VS Code with all its settings and extensions deleting the

    %UserProfile%\.vscode
    %AppData%\CodeCode

    folders. So I started with a completly blank environment. But again when I create a new application with the nRF extension and build it, the environment doesn't find a vali cMake

    > Executing task: nRF Connect: Generate config nrf52833dk_nrf52833 for c:\Users\Andrea\Documents\NordicApps\blinky <
    
    Building blinky
    west build --build-dir c:\Users\Andrea\Documents\NordicApps\blinky\build_3 c:\Users\Andrea\Documents\NordicApps\blinky --pristine --board nrf52833dk_nrf52833 -- -DCMAKE_EXPORT_COMPILE_COMMANDS:BOOL=On -DNCS_TOOLCHAIN_VERSION:STRING="NONE" -DCONFIG_DEBUG_OPTIMIZATIONS=y -DCONFIG_DEBUG_THREAD_INFO=y
    
    -- west build: generating a build system
    FATAL ERROR: CMake is not installed or cannot be found; cannot build

    When I launched the VS Code for the first time from the nRF Toolchain Manager (after installed all the extensions needed) the program asked me to install the cMake Tools extension to configure the project. After that the cMake Toll asked me

    but if I choose 'yes' I can't see the kit of nRF toolchain

    . For this reason I don't select anyting but when I add building configuration to my application and click on the 'Build Configuration' button I get again the error above.


    I repeat that on my another personal notebook I didn't have any problem. I don't understand why.


    The situation begins to be frustrating and I'm thinking to change approach. Do you have any suggestion?

  • Hi,

    You are experiencing a Windows path problem which would need to be investigated further.
    I have reported the issue and waiting for a reply.

    One thing you could try would be to disable CMake Tools extension.
    Note also that you can enable/disable extensions in VS Code in specific workspaces. In this way, you can avoid conflicting extensions without the need to uninstall them.

    Best regards,
    Dejan

  • Thanks. I'll continue to try without VS Code and following the official guide. Let me know for any progress. Thanks again.

  • Hi,

    As said previously, you could try to disable CMake Tools extension or at least clicking "Not now" when asked about configuring the project and see if this helps.

    I'll let you know when I get any update on this issue.

    Best regards,
    Dejan

  • I could help if I knew what the nRF extension is doing in background. Is there a debug tool or anything like that?

  • Hi,

    Could you be more specific about what you would actually want to debug/see and how? What additional information are you interested in?

    Best regards,
    Dejan

Reply Children
  • Since its maybe a environment variable issue, I'd like to know where the extension are looking for the cmake (I suppose it should be in C:\ncs\v1.8.0\toolchain\opt\bin) and why.

  • Hi,

    To return to your original question, in your case there is an issue related to the capitalization of the environmental variable (expected Path and used PATH by the installation) and this has been reported internally.

    C:\ncs\v1.8.0\toolchain path contains all the tools necessary for the SDK v1.8.0 including compiler, linker, build tools, debugger and required modules including west. Cmake is called using west.

    Best regards,
    Dejan

  • To return to your original question, in your case there is an issue related to the capitalization of the environmental variable (expected Path and used PATH by the installation) and this has been reported internally.

    After few months I reinstalled the NCS and now works fine. I suppose due to updates. Thanks for your support.

Related