catkin debug subset of packages
How do I use catkin_tools
to build only a subset of packages from the current workspace in debug mode?
To build the whole workspace in debug mode, you would call catkin build --cmake-args -DCMAKE_BUILD_TYPE=Debug
which sets the cmake variable CMAKE_BUILD_TYPE
for all packages.
But how can I set different variable values for different packages in the same workspace?
Asked by Christian Rauch on 2018-08-13 07:44:21 UTC
Answers
I have a similar situation and use a workaround way to do this. In my case, I need to build 2 sets, [packs1] in release and [packs2] in debug, and some of packages in [packs2] depends on some packs in packs1. I would do:
catkin config --cmake-args -DCMAKE_BUILD_TYPE=Release
catkin build [packs1]
catkin config --blacklist [packs1]
catkin config --cmake-args -DCMAKE_BUILD_TYPE=Debug
catkin build [packs2]
The settings of the whole workspace changed after the [packs1] are built, but [packs1] will not be rebuilt since black-listed. I also considered not changing workspace settings and using catkin build [packs2] --cmake-args -DCMAKE_BUILD_TYPE=Debug
, but in verbose mode you can see the argument list of cmake command has both -DCMAKE_BUILD_TYPE=Debug
and -DCMAKE_BUILD_TYPE=Release
, I don't know how this is defined, so for safety I change the ws settings. It turns out the [packs2] work properly.
Asked by Fred C on 2021-02-02 00:11:49 UTC
Comments
I don't believe this is currently supported, unfortunately.
Or: it's not really supported. You could try to see whether you can setup two profiles with different
CMAKE_BUILD_TYPE
configured and different whilte/black lists for pkgs. I'm not sure it'll work (ie: have both sets available ..Asked by gvdhoorn on 2018-08-13 14:34:29 UTC
.. at the same time) though.
Another option could be two workspaces overlaid. One with the debug pkgs, the other with the regular ones.
Asked by gvdhoorn on 2018-08-13 14:35:00 UTC