Supplying configuration information for others using your project
In the previous section, we learned how to make our project installable so that others can consume our project by installing it on their system. But sometimes, delivering the artifacts is not enough. For example, if you are delivering a library, it must also be easy to import it into a project – especially a CMake project. In this section, we will learn how to make this importing process easier for other CMake projects.
There are convenient ways of importing a library, given that the project to be imported has the proper configuration files. One of the prominent ways of doing so is by utilizing the find_package()
method (which we will cover in Chapter 5, Integrating Third-Party Libraries and Dependency Management). If you have consumers that are using CMake in their workflows, they will be happy if they can just write find_package(your_project_name)
and start using your code. In this section, we will learn...