microsoft / vscode-cmake-tools

CMake integration in Visual Studio Code
https://marketplace.visualstudio.com/items?itemName=vector-of-bool.cmake-tools
MIT License
1.47k stars 454 forks source link

Unable to determine which CMake generator to use #660

Closed smfelsher closed 5 years ago

smfelsher commented 5 years ago

Brief Issue Summary

Unable to determine what CMake generator to use. Please install or configure a preferred generator, or update settings.json or your Kit configuration.

Platform and Versions

Other Notes/Information

I have a CMake toolchain file, gcc_nios.cmake:

#
# A toolchain file to cross-compile for the Nios II processor.
#

set(CMAKE_SYSTEM_NAME Generic)
set(CMAKE_SYSTEM_PROCESSOR nios)
set(CMAKE_SYSTEM_VERSION 1)

set(CMAKE_C_COMPILER nios2-elf-gcc)
set(CMAKE_CXX_COMPILER nios2-elf-g++)
set(CMAKE_ASM_COMPILER nios2-elf-gcc)
set(CMAKE_SIZE nios2-elf-size)

set(CMAKE_C_FLAGS_INIT "-mno-hw-div -mhw-mul -mno-hw-mulx -mgpopt=global"
    CACHE STRING "Altera Nios C flags")

set(CMAKE_CXX_FLAGS_INIT "-mno-hw-div -mhw-mul -mno-hw-mulx -mgpopt=global"
    CACHE STRING "Altera Nios C++ flags")

set(CMAKE_EXE_LINKER_FLAGS_INIT "-Wl,--gc-sections" CACHE STRING "Altera Nios Linker flags")

set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)

I created cmake-kits.json file:

[
   {
      "name": "GCC for Nios II",
      "toolchainFile": "../cmake/toolchain/gcc_nios.cmake",
      "environmentVariables": {
         "PATH": "/home/steve/intelFPGA_lite/16.1/nios2eds/bin/gnu/H-x86_64-pc-linux-gnu/bin:/home/steve/intelFPGA_lite/16.1/nios2eds/sdk2/bin:/home/steve/intelFPGA_lite/16.1/nios2eds/bin:$PATH"
      },
      "preferredGenerator": {
         "name": "Unix Makefiles"
      }
   }
]

When I use the CMake Tools extension to configure my project, I am presented with the error message presented above.

zt-luo commented 5 years ago

also have this problems

KoeMai commented 5 years ago

Hey could you provide use a logfile. This would help to see more Details.

https://vector-of-bool.github.io/docs/vscode-cmake-tools/troubleshooting.html#checking-the-log-file

smfelsher commented 5 years ago

I no longer have the plugin installed.