Ask Your Question
0

Help with CMake parameters for catkin_make

asked 2014-04-22 02:04:36 -0600

Nap gravatar image

updated 2014-04-22 02:21:02 -0600

Hi, I have a project that I'm trying to adapt to ROS. Using catkin_make, it compiles ok, with clang++, but it fails on linking. It needs to be linked with a series of object files (*.o) that are part of another (non-catkin) project.
I'm not sure how to add these dependencies to the target in CMakeLists.txt, and I don't know how to specify the equivalent CMake parameters in the catkin_make command. There are a few other parameters I would like to pass as well.

In my CMakeLists.txt, I've added all the include_directories() and target_link_libraries().
I pass -DCMAKE_BUILD_TYPE=Debug -DCMAKE_C_COMPILER=/usr/bin/clang -DCMAKE_CXX_COMPILER=/usr/bin/clang++ on the command line to catkin_make. So far so good.

I would also like to pass the following compile parameters (or put them in my CMakeLists.txt file) but don't know how:
-fobjc-arc
-fPIC
-std=c++11 -stdlib=libstdc++
-Weverything -Wno-undef -Wno-long-long -Wno-c++98-compat-pedantic -Wno-sign-conversion -Wno-disabled-macro-expansion -Wno-weak-vtables -Wno-padded -Wno-unknown-pragmas -Wno-pedantic -Werror

and the following link parameters, but also don't know how:
-rdynamic
-stdlib=libstdc++
(a series of object files to link together) Do I need to move the source files into my catkin_ws?
-L/usr/lib/x86_64-linux-gnu
-R/usr/lib/x86_64-linux-gnu

The reason for all these parameters is that they are part of the clang++ command line when building the project using make (outside of catkin).

Any help would be appreciated.
Cheers, Nap

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
0

answered 2014-04-25 10:13:06 -0600

Tom Moore gravatar image
edit flag offensive delete link more

Comments

Thanks Thomas, but after I found the info mentioned my answer above, I was able to figure out everything I needed. My project now is successfully built and I can debug it in Code::Blocks, which I'm using.

Nap gravatar imageNap ( 2014-05-04 03:10:05 -0600 )edit
0

answered 2014-04-23 20:32:59 -0600

Nap gravatar image

man cmake and man clang have been useful.

cmake --help-commands [file] - Print help for all commands and exit.

Full documentation specific for all current command is displayed.If a file is specified, the documentation is written into and the  output  format  is determined depending on the filename suffix. Supported are man page, HTML, DocBook and plain text.

cmake --help-variables [file] - Print help for all variables and exit.

Full documentation for all variables is displayed.If a file is specified, the documentation is written  into  and  the  output  format  is  determined depending on the filename suffix. Supported are man page, HTML, DocBook and plain text.

Slowly I'm understanding how to pass variables in.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2014-04-22 02:04:36 -0600

Seen: 1,285 times

Last updated: Apr 25 '14