catkin_make is cmake + make!
The only difference is that it sets a few ENV variables before doing the actual cmake and make. At least for practical purposes it is safe to assume this, I guess.
For a catkin package, you don't have to do cmake at all. catkin_make will take care of all that.
One of the greatest advantages with catkin (in my opinion as a rookie user) is that it produces out of source builds - superb for portability, since you could just copy the source folder and compile it anywhere. This was not the case with rosbuild, which was apparently not entirely 'cmake'.
When you do a cmake in the source directory, you are in essence wasting this advantage (again only my opinion).
When you run cmake and make, doing catkin_make again will indeed produce two executables. a cmake + make from catkin will produce one executable in the catkin_workspace/devel. And a cmake + make that you did will produce an executable in the catkin_workspace/src/devel
folder.
I suggest that you do ONLY ONE of the following:
catkin_make
from the catkin_workspace folder or the base of the catkin_workspace.
OR - go into the build directory and create a directory for your build files.
suppose your project is called
superb_project_1
, then you will have sources in catkin_workspace/src/superb_project_1
.
Now go into catkin_workspace/build
and create a superb_project_1
folder.
Then go into this folder and execute the following command:
cmake ../../src/PROJECT_NAME -DCMAKE_INSTALL_PREFIX=../../install -DCATKIN_DEVEL_PREFIX=../../devel -G"Eclipse CDT4 - Unix Makefiles"
or in this particular case it is
cmake ../../src/superb_project_1 -DCMAKE_INSTALL_PREFIX=../../install -DCATKIN_DEVEL_PREFIX=../../devel -G"Eclipse CDT4 - Unix Makefiles"
Every time you need to build your project, go into build and do
cmake .
make
The last argument, as you are probably already aware, produces Eclipse .project files. It is optional and extremely helpful. Though this command has to be executed each time for every project created, it is extremely useful with eclipse.
Once imported into eclipse, all you have to do is click build project
and eclipse takes care of the rest. This method is easy, doesn't involve doing a catkin_make (which means you can simply make just one project - But you take care of dependencies) and also preserves the overall idea of out-of-source builds.