Importing a CMake project into Eclipse CDT

前端 未结 6 1328
Happy的楠姐
Happy的楠姐 2021-01-30 16:49

I have a native CMake project, and I want to use the Eclipse IDE with it so that it makes my development easier by providing auto-complete and and other features. I can\'t seem

6条回答
  •  梦毁少年i
    2021-01-30 17:40

    I just learned that CMake’s CDT project generator appears to be unmaintained and has caused various problems—especially, it seems, with later versions of Eclipse (of which I had my share as well).

    The recommendation is to use cmake4eclipse (available from Eclipse Marketplace), which uses CMakeLists.txt as its only source of truth. It also allows you to keep the source tree separate from your workspace.

    • In Eclipse, select File > New > C Project.
    • Enter a project name and choose the root of your source tree as the project location.
    • Select Executable > Empty Project as the project type, and accept the default toolchain.
    • Click Finish, and you have a CMake project in your workspace.

提交回复
热议问题