<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<p>Hi Craig,</p>
<p>thanks for the detailed explanation !<br>
</p>
<div class="moz-cite-prefix">On 2019-09-29 5:13 a.m., Craig Scott
wrote:<br>
</div>
<blockquote type="cite"
cite="mid:CA+dygY=qaUHf+1b69KRqyUfXwq3uX313Rc2s1o8awfEg_=DVmw@mail.gmail.com">
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<div dir="ltr">
<div dir="ltr">
<div dir="ltr">
<div dir="ltr">
<div dir="ltr">
<div dir="ltr">
<div dir="ltr"><br>
<div>If all of your headers should be installed to a
single directory, then you can list the headers in
the target's PUBLIC_HEADER or PRIVATE_HEADER
target property, then make sure you add those
destinations in the <font face="monospace">install(TARGETS
...)</font> command. For example:</div>
<div><br>
</div>
<div><font face="monospace">include(GNUInstallDirs)</font></div>
<div><font face="monospace">install(TARGETS myLib</font></div>
<div><font face="monospace"> EXPORT
SomeProj_Targets</font></div>
<div><font face="monospace"> RUNTIME DESTINATION
${CMAKE_INSTALL_BINDIR}</font></div>
<div><font face="monospace"> COMPONENT
SomeProj_Runtime</font></div>
<div>
<div><font face="monospace"> LIBRARY
DESTINATION ${CMAKE_INSTALL_LIBDIR}</font></div>
</div>
<div>
<div><font face="monospace"> COMPONENT
SomeProj_Runtime</font></div>
<div><font face="monospace">
NAMELINK_COMPONENT SomeProj_Development #
Requires CMake 3.12</font></div>
<div><font face="monospace"> ARCHIVE
DESTINATION ${CMAKE_INSTALL_LIBDIR}</font></div>
</div>
<div><font face="monospace"> COMPONENT
SomeProj_Development</font></div>
<div><font face="monospace"> PUBLIC_HEADER
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}</font></div>
<div><font face="monospace"> COMPONENT
SomeProj_Development</font></div>
<div><font face="monospace"> INCLUDES DESTINATION
${CMAKE_INSTALL_INCLUDEDIR}</font></div>
<div><font face="monospace">)</font></div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</blockquote>
<p>I hadn't noticed one can have multiple 'COMPONENT' sections in a
single `install` call. The CMake documentation could be a bit more
clear about that.<br>
</p>
<blockquote type="cite"
cite="mid:CA+dygY=qaUHf+1b69KRqyUfXwq3uX313Rc2s1o8awfEg_=DVmw@mail.gmail.com">
<div dir="ltr">
<div dir="ltr">
<div dir="ltr">
<div dir="ltr">
<div dir="ltr">
<div dir="ltr">
<div dir="ltr">
<div><br>
</div>
<div>If you need to install headers into more than
one directory (i.e. your headers have some sort of
directory hierarchy), then the above doesn't work
because it flattens all of the headers into a
single location. Instead, you have to use <font
face="monospace">install(FILES ...)</font> to
install the headers directly for such cases. Also,
the <font face="monospace">target_include_directories()</font> command
has nothing to do with what header files get
installed. Rather, it only controls the header
search paths attached to a target.</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</blockquote>
<p>Right, true.<br>
</p>
<blockquote type="cite"
cite="mid:CA+dygY=qaUHf+1b69KRqyUfXwq3uX313Rc2s1o8awfEg_=DVmw@mail.gmail.com">
<div dir="ltr">
<div dir="ltr">
<div dir="ltr">
<div dir="ltr">
<div dir="ltr">
<div dir="ltr">
<div dir="ltr">
<div>FYI, part of my CppCon talk "Deep CMake For
Library Authors" from a couple of weeks ago has a
fair amount of overlap with this topic
(specifically install components and
destinations). I'm waiting for the YouTube clip to
be made available and then I'll be posting a blog
article on my website with links and the slides.
When it goes up, you'll be able to find it at <a
href="https://crascit.com"
moz-do-not-send="true">https://crascit.com</a> (hopefully
sometime this week, but depends how quickly the
production people get the video done).</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</blockquote>
<p>Great, looking forward to reading the slides.</p>
<p>Many thanks !</p>
<div class="moz-signature">
<div class="moz-signature">
<div class="moz-signature">
<pre><img moz-do-not-send="false" src="cid:part2.D7BA88D1.30865616@seefeld.name" alt="Stefan" width="123" height="77">
--
...ich hab' noch einen Koffer in Berlin...
</pre>
</div>
</div>
</div>
</body>
</html>