# find\_package and build configuration

**URL:** https://discourse.cmake.org/t/find-package-and-build-configuration/4530
**Category:** Usage
**Created:** [November 23, 2021, 2:48pm UTC](https://discourse.cmake.org/t/find-package-and-build-configuration/4530 "2021-11-23T14:48:21Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![adaldev](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/a/9dc877/32.png) [@adaldev](https://discourse.cmake.org/u/adaldev)
#### Post date: [November 23, 2021, 2:48pm UTC](https://discourse.cmake.org/t/find-package-and-build-configuration/4530/1 "2021-11-23T14:48:21Z")

</div>

Hi,

Out of curiosity, how does find\_package selects the right configuration?

if I have a target in “Debug” it imports the dependencies in “Debug”, dito in “Release”.

What’s the behaviour with custom configurations?

What’s the behaviour if the dependency has no configuration with the same name as the target?

Thanks,  
A.

---

<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: [November 24, 2021, 2:28am UTC](https://discourse.cmake.org/t/find-package-and-build-configuration/4530/2 "2021-11-24T02:28:37Z")

</div>

There is the [`MAP_IMPORTED_CONFIG_<CONFIG>`](https://cmake.org/cmake/help/latest/prop_tgt/MAP_IMPORTED_CONFIG_CONFIG.html) property for this. I’m not sure if/where the fallback algorithm is documented off hand though.

---

<div class="post-metadata">

### Author: ![adaldev](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/a/9dc877/32.png) [@adaldev](https://discourse.cmake.org/u/adaldev)
#### Post date: [December 2, 2021, 10:19am UTC](https://discourse.cmake.org/t/find-package-and-build-configuration/4530/3 "2021-12-02T10:19:07Z")

</div>

Thanks for the pointer,

Regards,  
A.
