[CMake] [Config-file Package] The best practice of finding package dependencies?

Konstantin Podsvirov konstantin at podsvirov.pro
Tue Jun 20 23:46:20 EDT 2017


Hello community!

I want to give a little discussion :)

If I export a package containing several targets.
And these target are publicly linked to the targets imported from another package.
Where is the best place to look for package dependencies?

I assume the following options:
- In the Config-file of the package itself;
- The user himself must find them in his project.

It seems to me that to force the user to look for the dependencies of the package, which he himself seeks there is bad tone, but also to impose on the user, then how I myself found these dependencies in Config-file may not appeal to everyone.

Perhaps there should be some option for setting the behavior of the `find_package` command in the part of finding package dependencies? Or she already is, but I have not yet studied it.

--
Regards,
Konstantin Podsvirov


More information about the CMake mailing list