1

I use CMake as a build manager for a C++ project. All my sources are in a src subdirectory, and I created a sibling build directory. Following the directions from https://cmake.org/Wiki/Eclipse_CDT4_Generator, the build commands I use are:

cd build
cmake -G"Eclipse CDT4 - Unix Makefiles" -D CMAKE_BUILD_TYPE=Debug ../src

This creates the .project and .cproject files used to import an existing project in Eclipse. In the IDE, everything seems to work perfectly, except that the make target does not work.

When I click on a build target, the CDT build console opens, but nothing occurs. Also when I click on Project / Clean in the Eclipse dropdown menus, nothing occurs. I checked the commands invoked by the targets, and they are of the form /usr/bin/make -j8, which should work.

Can anyone help me get the make target work ?

vkubicki
  • 1,104
  • 1
  • 11
  • 26

2 Answers2

1

An automatic update to CDT just occurred and everything works now. So check for updates I guess.

vkubicki
  • 1,104
  • 1
  • 11
  • 26
0

Hope this is followed to create target....

The docs for eclipse says: Your project name should be different from your executable name and different from your build folder name. Otherwise, Eclipse will NOT pick up your executable as you build them. Since my build folder name is certi_build, a CMakeLists.txt file like below should work (notice the difference in project name and executable name)

 PROJECT(AwesomeProject)

 ADD_EXECUTABLE(AwesomeProjectMain
   main.cpp
   util.h
   util.cpp
               )
arun
  • 72
  • 8