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

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.

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

1 Like

Thank you, yes it does!

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.