conditional <exec_depend> in package.xml
I am writing some tests for a research version of FreeBSD. In certain configurations, I have an available library against which I want to build. In other configurations, the library doesn't exist and I need to avoid any dependency on it.
I would like to do this by making the library a conditional dependency based on an argument passed to cmake (via colcon). E.g., if I use --cmake-args -DHAS_LIBRARY=1
then it builds against the library, but otherwise ignores it.
This is fairly straightforward in my CMakeList.txt file, since I can just wrap find_package
and ament_target_dependencies
in conditional statements.
I don't know how to do this in the package.xml file. Further, I expect this isn't really possible and I'm going about this the wrong way entirely...
What I'd LIKE to do is wrap my <exec_depend>conditional_library_package</exec_depend>
statement in a conditional (I recognise I'm mixing and matching semantics here, but it seemed the easiest way to explain what I'm hoping to do).