0
$\begingroup$

Rosanswers logo

Hi,

I was wondering if there was an equivalent to ```catkin_find --lib --include`` in ros2.

I need this information to create a non ros package that includes ros publishers and subscribers.

Currently, I am using a workaround which is to use ros2 pkg prefix foo to find the messages created by the workspace and then move my way up the folders using ../.

I was wondering if there was a better way of doing this.

Also, if it is not to much trouble, cmake_ament no longer uses pkg-config to find packages. How can I add my workspace's libraries to the CMakelist? This is for the case of custom msgs and services.


Originally posted by Obeseturtle on ROS Answers with karma: 185 on 2019-01-24

Post score: 0

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

I am using a workaround which is to use ros2 pkg prefix foo to find the messages created by the workspace and then move my way up the folders using ../.

Why do you have to move up in this case?

The command will return the install prefix of the package foo. All files installed by that package will be in subdirectories, e.g. bin, include, lib, share.

If you need pkg-config like results you can invoke cmake --find-package ... to get information about include directories, libraries etc. (see Find-Package Tool Mode).


Originally posted by Dirk Thomas with karma: 16276 on 2019-01-24

This answer was ACCEPTED on the original site

Post score: 0


Original comments

Comment by Obeseturtle on 2019-01-24:
Thank you very much for your response.

Why do you have to move up in this case?

This was just a mistake on my part.

As you mentioned the include, lib. and shared could be found by using the prefix command. I will try using the suggested cmake --find-package command. Thank you again

$\endgroup$

Your Answer

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