# Third party package problem

**URL:** <https://discourse.cmake.org/t/third-party-package-problem/8516>\
**Category:** Code\
**Created:** [July 14, 2023, 11:35am UTC](https://discourse.cmake.org/t/third-party-package-problem/8516 "2023-07-14T11:35:25Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Richter\_Tobias](https://discourse.cmake.org/user_avatar/discourse.cmake.org/richter_tobias/32/3609_2.png) [@Richter\_Tobias](https://discourse.cmake.org/u/Richter_Tobias)\
**Post date:** [July 14, 2023, 11:35am UTC](https://discourse.cmake.org/t/third-party-package-problem/8516/1 "2023-07-14T11:35:25Z")

</div>

Hi,

I try to build a project that depends on a third party sdk, which is available as conan package. However, this package only contains a build for CMAKE\_BUILD\_TYPE “Release”. If I build the project with the CMAKE\_BUILD\_TYPE in Release, the build succeeds as expected. However, when trying to build in Debug mode, which is required to execute tests, project does not link at all against the third party libraries provided by the package.

My CmakeLists.txt looks something like this:

> find\_package(xyz REQUIRED)  
> include\_directories(xyz\_INCLUDE\_DIRS)
> 
> add\_library(mylib SHARED src/file.cpp)
> 
> target\_link\_libraries(mylib PUBLIC xyz::xyz)

Is there a way to link against the “Release” version of the third party package while actually in “Debug”?

Kind regards  
Tobias

---

<div class="post-metadata">

**Author:** ![Richter\_Tobias](https://discourse.cmake.org/user_avatar/discourse.cmake.org/richter_tobias/32/3609_2.png) [@Richter\_Tobias](https://discourse.cmake.org/u/Richter_Tobias)\
**Post date:** [July 14, 2023, 12:07pm UTC](https://discourse.cmake.org/t/third-party-package-problem/8516/2 "2023-07-14T12:07:43Z")

</div>

Using:  
set(CMAKE\_MAP\_IMPORTED\_CONFIG\_DEBUG RELEASE)  
before the find\_package resolved my problem
