[CMake] How should config packages handle components?

Alan W. Irwin irwin at beluga.phys.uvic.ca
Wed Sep 6 03:29:35 EDT 2017


On 2017-09-05 14:33-0500 Robert Dailey wrote:

> In the case where I'm exporting 1 target.cmake script per component
> for a single package, could someone provide an example on how to
> manage dependencies? There are 2 types of dependencies:
>
> 1. Dependencies on external packages
> 2. Cross-dependencies within the same package (i.e. on other
> components in the same package)
>
> The cmake-packages doc kind of goes over #1, but #2 doesn't seem to
> have examples.

Hi Robert:

This is an interesting topic to me because I am not at all satisfied
with the way that PLplot currently exports its components (which have
both kinds of the above dependencies).  I implemented those exports a
decade ago so the result is far from best practices.  Therefore, I am
glad you have brought up this topic, and I am looking forward to
seeing how your questions are finally answered.

To make it easier to get those final answers on best export practices,
I suggest you implement the simplest possible example with say two
components that have the two kinds of dependencies above. Then follow
up by asking the experts here to comment on the best export practices
for that simple example with the goal that once your simple example
has been modified to use best export practices that it should be
published in the CMake Wiki.  Such an example would be a big help to
me and I presume others as well who want to modernize the exports
from their project or who are designing a build system from scratch
for a project with multiple components that are exported.

By the way, I think cross-posting is a bad idea since it means those
subscribed to both lists always get annoying duplicate posts. So I
have thought about which list should be used for this topic, and my
conclusion is it belongs on the CMake list for now since it is about
how to use CMake rather than about some suggested CMake implementation
change.  But it can always be moved later to the CMake developer list
in the unlikely event that some CMake implementation change is
required to allow build-system designers to follow best export
practices.

Alan
__________________________
Alan W. Irwin

Astronomical research affiliation with Department of Physics and Astronomy,
University of Victoria (astrowww.phys.uvic.ca).

Programming affiliations with the FreeEOS equation-of-state
implementation for stellar interiors (freeeos.sf.net); the Time
Ephemerides project (timeephem.sf.net); PLplot scientific plotting
software package (plplot.sf.net); the libLASi project
(unifont.org/lasi); the Loads of Linux Links project (loll.sf.net);
and the Linux Brochure Project (lbproject.sf.net).
__________________________

Linux-powered Science
__________________________


More information about the CMake mailing list