# How do I install a library as a find-able package?

**URL:** <https://discourse.cmake.org/t/how-do-i-install-a-library-as-a-find-able-package/5150>\
**Category:** Code\
**Tags:** os:linux, gen:ninja\
**Created:** [March 2, 2022, 11:48pm UTC](https://discourse.cmake.org/t/how-do-i-install-a-library-as-a-find-able-package/5150 "2022-03-02T23:48:00Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Chrinkus](https://discourse.cmake.org/user_avatar/discourse.cmake.org/chrinkus/32/1801_2.png) [@Chrinkus](https://discourse.cmake.org/u/Chrinkus)\
**Post date:** [March 2, 2022, 11:48pm UTC](https://discourse.cmake.org/t/how-do-i-install-a-library-as-a-find-able-package/5150/1 "2022-03-02T23:48:00Z")

</div>

I have a C utility library that I’ve been using CMake to build and install. Now I want to access my library in a GTK project I’m doing that is (sorry) using Meson to build. When I list my library as a dependency Meson is unable to find it.

I can link it as a library but the ‘dependency’ functionality is looking for a package. I’ve looked it up in the Professional CMake book and I’m waist-deep in the CPack chapter now.

I’m not looking for someone to explicitly tell me what to do but instead point me in the right direction to find out how my installed library can be discoverable by other projects.

For info I’m on Ubuntu and generating with Ninja.

---

<div class="post-metadata">

**Author:** ![McMartin](https://discourse.cmake.org/user_avatar/discourse.cmake.org/mcmartin/32/150_2.png) [@McMartin](https://discourse.cmake.org/u/McMartin)\
**Post date:** [March 3, 2022, 7:56am UTC](https://discourse.cmake.org/t/how-do-i-install-a-library-as-a-find-able-package/5150/2 "2022-03-03T07:56:04Z")

</div>

Have you read [https://cmake.org/cmake/help/latest/manual/cmake-packages.7.html](https://cmake.org/cmake/help/latest/manual/cmake-packages.7.html) already? It should answer a few of your questions.

---

<div class="post-metadata">

**Author:** ![Chrinkus](https://discourse.cmake.org/user_avatar/discourse.cmake.org/chrinkus/32/1801_2.png) [@Chrinkus](https://discourse.cmake.org/u/Chrinkus)\
**Post date:** [March 3, 2022, 1:39pm UTC](https://discourse.cmake.org/t/how-do-i-install-a-library-as-a-find-able-package/5150/3 "2022-03-03T13:39:25Z")

</div>

Thank you, yes it does!

---

<div class="post-metadata">

**Author:** ![ClausKlein](https://discourse.cmake.org/user_avatar/discourse.cmake.org/clausklein/32/352_2.png) [@ClausKlein](https://discourse.cmake.org/u/ClausKlein)\
**Post date:** [March 29, 2022, 6:59am UTC](https://discourse.cmake.org/t/how-do-i-install-a-library-as-a-find-able-package/5150/4 "2022-03-29T06:59:11Z")

</div>

This project may help to simplify the task: [GitHub - TheLartians/PackageProject.cmake: 🏛️ Help other developers use your project. A CMake script for packaging C/C++ projects for simple project installation while employing best-practices for maximum compatibility.](https://github.com/TheLartians/PackageProject.cmake)
