How to configure Eclipse CDT for cmake?

In Eclipse-CDT you do not create cmake projects but you import cmake projects. This is what you should do:

  1. Say the source of your CMake project named “Planner” is located in D:/javaworkspace/src/Planner
  2. Create a folder (the folders NEED to be parallel to each other): D:/javaworkspace/build/Planner
  3. Go to the folder D:/javaworkspace/build/Planner and run CMake using the Eclipse generator: cmake ../../src/Planner -G"Eclipse CDT4 - Unix Makefiles" This will generate the make files for your Planner project.
  4. To import this in Eclipse do the following:File -> Import -> C/C++ -> Existing code as Makefile projectand select D:/javaworkspace/build/Planner (the build output folder with the make files) as the “Existing Code location”

However, looking at your paths it seems to me that you are working on Windows. In windows CMake can generate Visual Studio projects. If you want to use CMake I suggest first creating a “hello world” project using CMake (remember, Eclipse does not create CMake projects, you have to create a CMakeLists.txt file by hand)

Leave a Comment