Trying to write FindRecastNavigation.cmake to cover multiple libraries

Hello! I’m struggling a bit and I’m hoping someone can help guide/educate me on how best to do this…

I’m trying to figure how to get multiple libraries to be detected and exposed. I have it finding and exposing libRecast.so, but I also need libDetour.so and LibDebugUtil.so

By exposing, I mean like this:
RecastNavigation::Recast
RecastNavigation::Detour
RecastNavigation::DebugUtil

It’s very possible I’m going about this all wrong and that there is an easier way! :slight_smile:

WIP code:

Any help would be appreciated.
Cheers!

I’ve reviewed the MR you linked with some suggestions. Overall it looks like the right pattern that just needs to be repeated for libDetour and libDebugUtil.

Thank you! I’ll look into it, but which pattern precisely do I need to repeat for libDetour. The biggest problem is that I can seem to get it to include libDetour.so … or that will be impossible without duplicating the whole bit for libDetour/libDebugUtil like for libRecast ?

The 3 libs are all part of the RecastNavigation pakage.

I would just find the multiple libraries and then express their dependencies as INTERFACE_LINK_LIBRARIES. You can see how the X11 find package handles its oodles of libraries here.