<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div style="color: rgb(0, 0, 0); font-family: Calibri,Helvetica,sans-serif; font-size: 12pt;">
<p>Alan,</p>
<p><br>
</p>
<p>Thank you very much for the response.</p>
<p><br>
</p>
<p>Our 'foo' package <u>does not </u>use CMake. That means there is <u>no build-system
</u>to produce the foo-config.cmake file, the file is manually created.  The file does allow different projects to import the target from 'foo' package that has been installed. However, we need to include the library and config file in CPack installer and who
 is responsible for that task?</p>
<p><br>
</p>
<div style="margin-top: 0px; margin-bottom: 0px;"></div>
<p>We are using Qt5 config mode to import targets like you describe in development context and it works. However, to setup packaging system (CPack) we need to perform the Install(..) command so
<br>
that the necessary Qt5 targets are included in the installer (MSI and RPM). We cannot require the customer to install a 2GB Qt5 installer for a few libraries. In that context it is unclear who\when\how should perform the installation.</p>
<p><br>
</p>
<p>kind regards, Lars</p>
<br>
</div>
<div>
<div id="appendonsend"></div>
<div style="color: rgb(0, 0, 0); font-family: Calibri,Helvetica,sans-serif; font-size: 12pt;">
<br>
</div>
<hr tabindex="-1" style="width: 98%; display: inline-block;">
<div id="divRplyFwdMsg" dir="ltr"><font color="#000000" face="Calibri, sans-serif" style="font-size: 11pt;"><b>Fra:</b> Alan W. Irwin <Alan.W.Irwin1234@gmail.com><br>
<b>Sendt:</b> tirsdag 22. januar 2019 09.29<br>
<b>Til:</b> Lars<br>
<b>Kopi:</b> cmake@cmake.org<br>
<b>Emne:</b> Re: [CMake] find_package config and install</font>
<div> </div>
</div>
<div class="BodyFragment"><font size="2"><span style="font-size: 11pt;">
<div class="PlainText">On 2019-01-21 11:09-0000 Lars wrote:<br>
<br>
> Hello,<br>
><br>
> We are creating a foo-config.cmake file for a package. The 'foo' package contain a dynamic library that provides two interfaces and a number of configuration files. There is a mapping between an interface and required configuration files. What is the recommended
 approach for installing targets and necessary configuration files in this context? Should this be performed by foo-config.cmake or system that performed find_package? If foo-config.cmake should perform the install, how should it be informed of which interface
 is required? Can the "components" tag be used for this task?<br>
><br>
> Qt 5.11 support config mode but does not perform any install. Does anyone know why?<br>
><br>
> We are using CMake 3.13.2<br>
><br>
<br>
Hi Lars:<br>
<br>
Here is an overview of packaging which I believe will<br>
be useful to you.<br>
<br>
foo-config.cmake does no installation itself.  Instead,<br>
the build system for project "foo" installs that file to<br>
help keep track of all the installed targets for foo that<br>
get exported by foo.  That file (and the many files it includes)<br>
allows different projects to import foo targets with ease<br>
from a foo package that has already been installed.<br>
<br>
So, for example, Qt5 config mode allows your project to import Qt5<br>
targets that have been exported by that project, but in order to<br>
access that functionality, Qt5 has to already be installed by some<br>
means completely independent of CMake.<br>
<br>
Some references that explain all this (and a lot more) are<br>
<<a href="https://cmake.org/cmake/help/latest/manual/cmake-packages.7.html">https://cmake.org/cmake/help/latest/manual/cmake-packages.7.html</a>>,<br>
the install(EXPORT...) variant of the install commmand documented in<br>
<<a href="https://cmake.org/cmake/help/latest/command/install.html">https://cmake.org/cmake/help/latest/command/install.html</a>>,<br>
and <<a href="https://cmake.org/cmake/help/latest/command/export.html">https://cmake.org/cmake/help/latest/command/export.html</a>>.<br>
<br>
In sum, cmake makes it trivially easy to import targets (e.g., from an<br>
already installed Qt5 package).  It is substantially more work to<br>
export targets from your own "foo" project using the foo-config.cmake<br>
approach because there are a fair number of details you have to keep<br>
track of to provide a useful result that other projects can import<br>
successfully.  But exporting is pretty straightforward once you<br>
have read the above documentation, and it sure makes life convenient<br>
for other projects which wish to import targets from an already<br>
installed foo package.<br>
<br>
Alan<br>
__________________________<br>
Alan W. Irwin<br>
<br>
Programming affiliations with the FreeEOS equation-of-state<br>
implementation for stellar interiors (freeeos.sf.net); the Time<br>
Ephemerides project (timeephem.sf.net); PLplot scientific plotting<br>
software package (plplot.sf.net); the libLASi project<br>
(unifont.org/lasi); the Loads of Linux Links project (loll.sf.net);<br>
and the Linux Brochure Project (lbproject.sf.net).<br>
__________________________<br>
<br>
Linux-powered Science<br>
__________________________<br>
</div>
</span></font></div>
</div>
</body>
</html>