0
$\begingroup$

Rosanswers logo

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


Originally posted by Nap on ROS Answers with karma: 302 on 2014-04-22

Post score: 0

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

http://stackoverflow.com/questions/15100351/changing-cmake-cxx-flags-in-project


Originally posted by Tom Moore with karma: 13689 on 2014-04-25

This answer was ACCEPTED on the original site

Post score: 0


Original comments

Comment by Nap on 2014-05-04:
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.

$\endgroup$

Your Answer

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