# find\_package does not set the include path for my target

**URL:** <https://discourse.cmake.org/t/find-package-does-not-set-the-include-path-for-my-target/7032>\
**Category:** Code\
**Created:** [December 7, 2022, 6:54pm UTC](https://discourse.cmake.org/t/find-package-does-not-set-the-include-path-for-my-target/7032 "2022-12-07T18:54:23Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![K20shores](https://discourse.cmake.org/user_avatar/discourse.cmake.org/k20shores/32/2987_2.png) [@K20shores](https://discourse.cmake.org/u/K20shores)\
**Post date:** [December 7, 2022, 6:54pm UTC](https://discourse.cmake.org/t/find-package-does-not-set-the-include-path-for-my-target/7032/1 "2022-12-07T18:54:23Z")

</div>

I’ve been trying to include an install target in projects that I work on. In the most recent change, I’ve been trying to modify our project to install to common locations and install the config files that are needed to use our project with find\_package. [This is the branch I’ve been working on](https://github.com/NCAR/musica-core/pull/62).

I’m trying to use the installed files from the branch above in another project. I’ve setup [a dockerfile](https://github.com/NCAR/tuv-x/pull/227/files#diff-dd2c0eb6ea5cfc6c4bd4eac30934e2d5746747af48fef6da689e85b752f39557) that shows the issue I’m having. Cmake is correctly able to find the package, but the include directories are not added by target\_link\_libraries.

Can anyone see what I’m doing wrong?

---

<div class="post-metadata">

**Author:** ![K20shores](https://discourse.cmake.org/user_avatar/discourse.cmake.org/k20shores/32/2987_2.png) [@K20shores](https://discourse.cmake.org/u/K20shores)\
**Post date:** [December 7, 2022, 9:59pm UTC](https://discourse.cmake.org/t/find-package-does-not-set-the-include-path-for-my-target/7032/2 "2022-12-07T21:59:58Z")

</div>

The issue happened because target\_link\_libraries was targeting the library I wanted to eventually create. However, all of the source files were changed in the linked PR to be added to an object library. The object library is what needed to link against the dependency. Once I made target\_link\_libraries target the object library, the include path was correctly added.
