0
$\begingroup$

Rosanswers logo

I've downloaded it a couple of days ago, but I still have not figure out how to configure it correctly to work with ROS.

If I import a simple ROS project it gives me the following error, but I can compile (and run) it from the terminal:

Error: By not providing "Findcatkin.cmake" in CMAKE_MODULE_PATH this project has asked CMake to find a package configuration file provided by "catkin", but CMake did not find one.
Could not find a package configuration file provided by "catkin" with any of the following names:
  catkinConfig.cmake   catkin-config.cmake
Add the installation prefix of "catkin" to CMAKE_PREFIX_PATH or set "catkin_DIR" to a directory containing one of the above files.  If "catkin" provides a separate development package or SDK, be sure it has been installed.

I'd like to know where to properly set these environmental variables and how can I get the equivalent of catkin_make from inside the IDE.

Thanks in advance!


EDIT 29.11.2018

After more than three years, thanks to this post and to a couple of similar ones, JetBrains has published an official guide for CLion 2018.3 (which is fine also for previous versions).

You can find it here: https://www.jetbrains.com/help/clion/2018.3/ros-setup-tutorial.html


Originally posted by alextoind on ROS Answers with karma: 217 on 2015-06-03

Post score: 7


Original comments

Comment by gvdhoorn on 2015-06-04:
Also see wiki.ros.org/IDEs.

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

It does not seem to find the catkin package in your environment variable. How did you start CLion? You should start it from a terminal which has all ROS setup bash scripts loaded. This ensures that all your environment variables are set correctly. For me CLion works out of the box, when I start it in a terminal and I select a CMakelist for the project. I can build, run and debug without any extra configuration hassle.


Originally posted by daenny with karma: 376 on 2015-06-03

This answer was ACCEPTED on the original site

Post score: 7


Original comments

Comment by alextoind on 2015-06-04:
Thank you very much, I didn't think about launching from terminal. It works like a charm now! Also, as pointed out by @gvdhoorn, in wiki.ros.org/IDEs there is the explaination for JetBrains PyCharm IDE which I haven't noticed while searching for 'CLion'.

Comment by gvdhoorn on 2015-06-04:
Might be nice to update the IDEs page to include a reference to your particular one. Would save future users some trouble.

Comment by mahi on 2015-06-08:
Following http://wiki.ros.org/IDEs I edited clion *.desktop file as following so that I don't have to start it from command line every time. Exec=bash -i -c "/bin/clion.sh" %f

Comment by bezcoder on 2015-06-26:
As suggested, by launching CLion from the terminal, that error doesn't come up anymore. Anyhow the build process doesn't work correctly as it outputs in some CLion system folder. Even if the catkin-generated CMakeCache looks fine, CLion uses a different BINARY_DIR for the project.

Comment by alextoind on 2015-06-27:
It should be fine to source the proper setup.bash. For example if you are on linux try with: source ~/.clion10/system/cmake/generated/<something>/<something>/Debug/devel/setup.bash

Comment by bezcoder on 2015-06-29:
That way the building works in CLion but breaks catkin_make, so I don't consider that as a solution. CLion should just use the makefile in the appropriate directory (ros/build/$projectName) but it seems that it is failing at that.

Comment by gcc05 on 2015-11-26:
I agree with @bezcoder that there should be a way to make CLion generate the files in the catkin ws folders. Has anyone advanced with that? Or if there is any way to use the debugger with the catkin_make generated binaries?

Comment by alextoind on 2015-11-26:
@grar05 actually you can use the debugger with binaries generated through build <something> from CLion, even if they are not those in the catkin workspace.

Comment by gcc05 on 2015-11-27:
Yes, I've been able to do that in some packages, but I have now a package that aborts when debugged from CLion (but not with the gdb command in the catkin_make binary). Also that I'd rather have the generated files in the workspace than compiling it twice, so debugging the catkin_made pkg would do.

Comment by Reuben John on 2016-11-07:
A ROS plugin for CLion requires one final Clion issue to be fixed. Voting for the fix will help speed things up!

Comment by alextoind on 2016-12-04:
Thanks for the info! Actually with CLion 2016.3 it is now possible to set the cmake build directory, but I have not found how to separate the devel directory which is natively put inside the build one.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.