I don’t really see the advantage of using dlopen directly. The .net way would be to create a class that contains the DllImport statements foreach RMW implementation and that is implemented against an interface or baseclass. Than you have some logic that decides at runtime which concrete class should be used and create your code against the interface.
Otherwise you are likely to mix some code that decides which rmw implementation to use with the code that actual call the native function. I think that would be a rather ugly design.
Also I couldn’t experience any problems with multiple RMW implementations (I have FastRTPS and OpenSplice installed). I would be suprised if there where any problems because “normal” enduser applications just link to the default rmw too.
The implementation into the buildsystem is still something I’m kind of afraid of. I will have a deeper look into your CMake code, but I think that’s a point I could really use some help.
I need to do some further debugging with my implementation on windows. I’m running into some troubles with strings on Windows, which aren’t passed correctly into the native code.
Thanks for publishing your code. I’m sure I will find some useful parts in it.