# Trying to write FindRecastNavigation.cmake to cover multiple libraries

**URL:** <https://discourse.cmake.org/t/trying-to-write-findrecastnavigation-cmake-to-cover-multiple-libraries/2841>\
**Category:** Code\
**Created:** [February 25, 2021, 1:08pm UTC](https://discourse.cmake.org/t/trying-to-write-findrecastnavigation-cmake-to-cover-multiple-libraries/2841 "2021-02-25T13:08:54Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![psi29a](https://discourse.cmake.org/user_avatar/discourse.cmake.org/psi29a/32/1240_2.png) [@psi29a](https://discourse.cmake.org/u/psi29a)\
**Post date:** [February 25, 2021, 1:08pm UTC](https://discourse.cmake.org/t/trying-to-write-findrecastnavigation-cmake-to-cover-multiple-libraries/2841/1 "2021-02-25T13:08:54Z")

</div>

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! 🙂

WIP code:

> **[Draft: initial attempt at FindRecastNavigation.cmake (!617) · Merge Requests...](https://gitlab.com/OpenMW/openmw/-/merge_requests/617/diffs)**
>
> To anyone with cmake knowledge, need to figure how to get multiple libraries to be detected. I have libRecast.so, but we also need libDetour.so and LibDebugUtil.so

Any help would be appreciated.  
Cheers!

---

<div class="post-metadata">

**Author:** ![ben.boeckel](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/b/ea5d25/32.png) [@ben.boeckel](https://discourse.cmake.org/u/ben.boeckel)\
**Post date:** [February 25, 2021, 2:52pm UTC](https://discourse.cmake.org/t/trying-to-write-findrecastnavigation-cmake-to-cover-multiple-libraries/2841/2 "2021-02-25T14:52:11Z")

</div>

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`.

---

<div class="post-metadata">

**Author:** ![psi29a](https://discourse.cmake.org/user_avatar/discourse.cmake.org/psi29a/32/1240_2.png) [@psi29a](https://discourse.cmake.org/u/psi29a)\
**Post date:** [February 25, 2021, 3:11pm UTC](https://discourse.cmake.org/t/trying-to-write-findrecastnavigation-cmake-to-cover-multiple-libraries/2841/3 "2021-02-25T15:11:20Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![ben.boeckel](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/b/ea5d25/32.png) [@ben.boeckel](https://discourse.cmake.org/u/ben.boeckel)\
**Post date:** [February 25, 2021, 3:32pm UTC](https://discourse.cmake.org/t/trying-to-write-findrecastnavigation-cmake-to-cover-multiple-libraries/2841/4 "2021-02-25T15:32:27Z")

</div>

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](https://gitlab.kitware.com/cmake/cmake/-/blob/master/Modules/FindX11.cmake#L573).
