# MAP\_IMPORTED\_CONFIG\_RELWITHDEBINFO in ExternalProject\_Add

**URL:** https://discourse.cmake.org/t/map-imported-config-relwithdebinfo-in-externalproject-add/1785
**Category:** Usage
**Created:** [September 5, 2020, 3:47pm UTC](https://discourse.cmake.org/t/map-imported-config-relwithdebinfo-in-externalproject-add/1785 "2020-09-05T15:47:27Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![dzenanz](https://discourse.cmake.org/user_avatar/discourse.cmake.org/dzenanz/32/83_2.png) [@dzenanz](https://discourse.cmake.org/u/dzenanz)
#### Post date: [September 5, 2020, 3:47pm UTC](https://discourse.cmake.org/t/map-imported-config-relwithdebinfo-in-externalproject-add/1785/1 "2020-09-05T15:47:27Z")

</div>

OpenCV only defines two configurations, Debug and Release. Trying to build a dependent project in RelWithDebInfo causes a [link error on MSVC](https://stackoverflow.com/questions/24262081/cmake-relwithdebinfo-links-to-debug-libs). A [solution](https://stackoverflow.com/a/24403456/276168) to that is to set MAP\_IMPORTED\_CONFIG\_RELWITHDEBINFO to RELEASE.

However, when building it via [ExternalProject\_Add](https://github.com/PlusToolkit/PlusBuild/blob/6cf8086d123981e6a349bf8888594287a4568508/SuperBuild/External_OpenCV.cmake#L85) I don’t know how to do an equivalent thing. Can it be done, and how?

---

<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 15, 2020, 2:49pm UTC](https://discourse.cmake.org/t/map-imported-config-relwithdebinfo-in-externalproject-add/1785/2 "2020-11-15T14:49:40Z")

</div>

You need to do that on the consuming side (wherever the `find_package(OpenCV)` is). I suppose you could patch the CMake package after installation, but that sounds finicky to get right. It also doesn’t work for anyone else using your OpenCV-consuming project with their own OpenCV build.
