<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:Wingdings;
        panose-1:5 0 0 0 0 0 0 0 0 0;}
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman",serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
p.MsoListParagraph, li.MsoListParagraph, div.MsoListParagraph
        {mso-style-priority:34;
        mso-margin-top-alt:auto;
        margin-right:0cm;
        mso-margin-bottom-alt:auto;
        margin-left:0cm;
        font-size:12.0pt;
        font-family:"Times New Roman",serif;}
p.msonormal0, li.msonormal0, div.msonormal0
        {mso-style-name:msonormal;
        mso-margin-top-alt:auto;
        margin-right:0cm;
        mso-margin-bottom-alt:auto;
        margin-left:0cm;
        font-size:12.0pt;
        font-family:"Times New Roman",serif;}
span.EmailStyle19
        {mso-style-type:personal-reply;
        font-family:"Calibri",sans-serif;
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
        {page:WordSection1;}
/* List Definitions */
@list l0
        {mso-list-id:471751311;
        mso-list-template-ids:-151200578;}
@list l1
        {mso-list-id:1425420983;
        mso-list-template-ids:-1242925928;}
@list l1:level1
        {mso-level-tab-stop:36.0pt;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l1:level2
        {mso-level-tab-stop:72.0pt;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l1:level3
        {mso-level-tab-stop:108.0pt;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l1:level4
        {mso-level-tab-stop:144.0pt;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l1:level5
        {mso-level-tab-stop:180.0pt;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l1:level6
        {mso-level-tab-stop:216.0pt;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l1:level7
        {mso-level-tab-stop:252.0pt;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l1:level8
        {mso-level-tab-stop:288.0pt;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l1:level9
        {mso-level-tab-stop:324.0pt;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
ol
        {margin-bottom:0cm;}
ul
        {margin-bottom:0cm;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="FI" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US">Oh, ok, my mistake then.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US">Confusion was caused by the fact that “barstatic” features via “fooshared” were actually used by the outside build tree
 via yet another exported library “abcshared”. Since “abcshared” is in the same build tree with the other parts, it gets access to “barstatic” regardless if it is exported or not. But it needed “barstatic” to be linked to “fooshared” PUBLIC and not PRIVATE.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US">I ended up linking “barstatic” in PRIVATE mode to both “fooshared” and “abcshared” and this works fine.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US">To avoid this kind of duplication, there could be some use for mode like PUBLIC_WITHIN_BUILDTREE a bit similar to defining
 include dirs for build and install separately using a generator expression.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US">Sorry for the hassle and thanks
</span><span lang="EN-US" style="font-size:11.0pt;font-family:Wingdings;color:#1F497D;mso-fareast-language:EN-US">J</span><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US"><o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US">-Lassi<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<div>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><b><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif">From:</span></b><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif"> Marc CHEVRIER <marc.chevrier@gmail.com>
<br>
<b>Sent:</b> torstai 28. helmikuuta 2019 12.20<br>
<b>To:</b> cmake-developers@cmake.org; Lassi Niemistö <lassi.niemisto@wapice.com><br>
<b>Subject:</b> RE: [cmake-developers] Mandatory export of a static library dependency<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<div name="messageBodySection">
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.5pt;font-family:"Arial",sans-serif">As I said, You
<b>don’t</b> have all symbols in fooshared when PUBLIC is used but, because barstatic is PUBLIC, it is included in link commands where fooshared is specified.
<o:p></o:p></span></p>
<div>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.5pt;font-family:"Arial",sans-serif"><o:p> </o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.5pt;font-family:"Arial",sans-serif">For example, specifying command 'target_link_libraries (any PRIVATE fooshared)’ is equivalent to 'target_link_libraries (any PRIVATE fooshared barstatic)’ because
 barstatic is specified as PUBLIC dependency of fooshared.<o:p></o:p></span></p>
</div>
</div>
<div name="messageReplySection">
<p class="MsoNormal"><span style="font-size:10.5pt;font-family:"Arial",sans-serif">Le 28 févr. 2019 à 11:14 +0100, Lassi Niemistö <</span><a href="mailto:lassi.niemisto@wapice.com"><span style="font-size:10.5pt;font-family:"Arial",sans-serif">lassi.niemisto@wapice.com</span></a><span style="font-size:10.5pt;font-family:"Arial",sans-serif">>,
 a écrit :<br>
<br>
<o:p></o:p></span></p>
<blockquote style="border:none;border-left:solid #1ABC9C 1.0pt;padding:0cm 0cm 0cm 8.0pt;margin-left:3.75pt;margin-top:3.75pt;margin-right:3.75pt;margin-bottom:3.75pt">
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US">Hello,</span><span lang="EN-US" style="font-size:10.5pt;font-family:"Arial",sans-serif"><o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US"> </span><span lang="EN-US" style="font-size:10.5pt;font-family:"Arial",sans-serif"><o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US">I understand it is a bit awkward scenario to need to have all
 symbols from barstatic available in fooshared and yes I can work around it by the OBJECT library method.</span><span lang="EN-US" style="font-size:10.5pt;font-family:"Arial",sans-serif"><o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US"> </span><span lang="EN-US" style="font-size:10.5pt;font-family:"Arial",sans-serif"><o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US">However, I see it contradictory to</span><span lang="EN-US" style="font-size:10.5pt;font-family:"Arial",sans-serif"><o:p></o:p></span></p>
<p class="MsoListParagraph" style="text-indent:-18.0pt"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US">Get all symbols from barstatic included into fooshared when linking it in PUBLIC mode</span><span lang="EN-US" style="font-size:10.5pt;font-family:"Arial",sans-serif"><o:p></o:p></span></p>
<p class="MsoListParagraph" style="text-indent:-18.0pt"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US">Still need to export also barstatic even when this is not necessary due to 1.</span><span lang="EN-US" style="font-size:10.5pt;font-family:"Arial",sans-serif"><o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US"> </span><span lang="EN-US" style="font-size:10.5pt;font-family:"Arial",sans-serif"><o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US">Clarification: the executable is spit out from the same build/cmake
 than fooshared. It uses only barstatic and not fooshared at all. The executable is not the problem, problem is the exporting of fooshared to external builds.</span><span lang="EN-US" style="font-size:10.5pt;font-family:"Arial",sans-serif"><o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US"> </span><span lang="EN-US" style="font-size:10.5pt;font-family:"Arial",sans-serif"><o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US">This goes towards generic discussion on what is the preferred
 way of creating both .so and .a versions of a library, check e.g. </span><a href="https://stackoverflow.com/questions/2152077/is-it-possible-to-get-cmake-to-build-both-a-static-and-shared-version-of-the-sam"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;mso-fareast-language:EN-US">https://stackoverflow.com/questions/2152077/is-it-possible-to-get-cmake-to-build-both-a-static-and-shared-version-of-the-sam</span></a><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US">.
</span><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US">Although the OBJECT library method works, it is clumsy due to needing to define target_include_directories, compiler flags etc multiple
 times and having yet another named target to maintain. It is more beautiful to just create the static lib as your base and then link the shared version to it, although it works only when the shared lib has at least one extra source file compared to the static
 version. Or, worked until the export stage.</span><span lang="EN-US" style="font-size:10.5pt;font-family:"Arial",sans-serif"><o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US"> </span><span lang="EN-US" style="font-size:10.5pt;font-family:"Arial",sans-serif"><o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US">-Lassi</span><span lang="EN-US" style="font-size:10.5pt;font-family:"Arial",sans-serif"><o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US"> </span><span lang="EN-US" style="font-size:10.5pt;font-family:"Arial",sans-serif"><o:p></o:p></span></p>
<div>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><b><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif">From:</span></b><span lang="EN-US" style="font-size:10.5pt;font-family:"Arial",sans-serif">
</span><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif">Marc CHEVRIER <</span><a href="mailto:marc.chevrier@gmail.com"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif">marc.chevrier@gmail.com</span></a><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif">><br>
<b>Sent:</b> torstai 28. helmikuuta 2019 11.37<br>
<b>To:</b> </span><a href="mailto:cmake-developers@cmake.org"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif">cmake-developers@cmake.org</span></a><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif">; Lassi
 Niemistö <</span><a href="mailto:lassi.niemisto@wapice.com"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif">lassi.niemisto@wapice.com</span></a><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif">><br>
<b>Subject:</b> Re: [cmake-developers] Mandatory export of a static library dependency</span><span lang="EN-US" style="font-size:10.5pt;font-family:"Arial",sans-serif"><o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span lang="EN-US" style="font-size:10.5pt;font-family:"Arial",sans-serif"> <o:p></o:p></span></p>
<div name="messageBodySection">
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span lang="EN-US" style="font-size:10.5pt;font-family:"Arial",sans-serif">Hi,<o:p></o:p></span></p>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span lang="EN-US" style="font-size:10.5pt;font-family:"Arial",sans-serif"> <o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span lang="EN-US" style="font-size:10.5pt;font-family:"Arial",sans-serif">It is perfectly normal that CMake requires static library to be exported when command ’target_link_libraries(fooshared
 barstatic)’ is specified because this is equivalent to command 'target_link_libraries(fooshared PUBLIC barstatic)’.<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span lang="EN-US" style="font-size:10.5pt;font-family:"Arial",sans-serif"> <o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span lang="EN-US" style="font-size:10.5pt;font-family:"Arial",sans-serif">As you have already discovered, using command 'target_link_libraries(fooshared PRIVATE barstatic)’ avoids
 exporting of barstatic library.<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span lang="EN-US" style="font-size:10.5pt;font-family:"Arial",sans-serif">Now, I think you did a wrong diagnostic regarding your link problems with this signature. Symbols visibility
 is not changed by specifying ‘PRIVATE’ but link commands are changed. With ‘PRIVATE’, the link command for your executable
<b>do not contains anymore a </b>reference to barstatic library. And the ‘fooshared’ library will contains
<b>only</b> objects from ‘barstatic’ needed to solved unreferenced symbols (so may be not all objects from ‘barstatic’).<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span lang="EN-US" style="font-size:10.5pt;font-family:"Arial",sans-serif"> <o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span lang="EN-US" style="font-size:10.5pt;font-family:"Arial",sans-serif">So to solve your problem you have two possibilities:<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span lang="EN-US" style="font-size:10.5pt;font-family:"Arial",sans-serif"> <o:p></o:p></span></p>
</div>
<div>
<ol start="1" type="1">
<li class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;mso-list:l1 level1 lfo3">
<span lang="EN-US" style="font-size:10.5pt;font-family:"Arial",sans-serif">Specify ‘barstatic’ library  as dependency of your executable, i.e. 'target_link_libraries(exec PRIVATE fooshared barstatic)’.<o:p></o:p></span></li><li class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;mso-list:l1 level1 lfo3">
<span lang="EN-US" style="font-size:10.5pt;font-family:"Arial",sans-serif">Ensure that all objects of `barstatic` are included in your ‘fooshared’ library. For that purpose, you can create `barstatic` as OBJECT library and include all objects in your ‘fooshared’
 library using pattern ‘add_library(fooshared SHARED .. $<TARGET_OBJECTS:barstatic> …)’. But the most simple is, may be, to put directly all your sources in ‘fooshared’ library.<o:p></o:p></span></li></ol>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span lang="EN-US" style="font-size:10.5pt;font-family:"Arial",sans-serif"> <o:p></o:p></span></p>
</div>
</div>
</div>
<div name="messageReplySection">
<p class="MsoNormal" style="mso-margin-top-alt:auto;margin-bottom:12.0pt"><span style="font-size:10.5pt;font-family:"Arial",sans-serif">Le 28 févr. 2019 à 08:25 +0100, Lassi Niemistö <</span><a href="mailto:lassi.niemisto@wapice.com"><span style="font-size:10.5pt;font-family:"Arial",sans-serif">lassi.niemisto@wapice.com</span></a><span style="font-size:10.5pt;font-family:"Arial",sans-serif">>,
 a écrit :<o:p></o:p></span></p>
<blockquote style="border:none;border-left:solid #E67E22 1.0pt;padding:0cm 0cm 0cm 8.0pt;margin-left:3.75pt;margin-top:3.75pt;margin-right:3.75pt;margin-bottom:3.75pt">
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span lang="EN-US" style="font-size:10.5pt;font-family:"Arial",sans-serif">Hello,<br>
<br>
The cmake "users" list did not wake any replies, so posting here as a possible bug:<br>
<br>
I use CMake 3.13RC1. My project produces, installs and exports a shared library target "fooshared". Some logical parts of "fooshared" are reused in an executable, so I have placed those sources into an internal static library target "barstatic". I have used
 target_link_libraries(fooshared barstatic) to make this work.<br>
<br>
Problem: when I try to:<br>
install(TARGETS fooshared DESTINATION <dest> EXPORT myexport)<br>
install(EXPORT myexport DESTINATION <dest>)<br>
..I get a whine about dependency to "barstatic" which is not in the export group "myexport".<br>
<br>
I wouldn't like to export "barstatic" at all, it should remain under the hood. I tried to use target_link_libraries(fooshared PRIVATE barstatic) which cut the export chaining, but then symbols from "barstatic" were not available for users of "fooshared" anymore.
 So I worked around this by converting "barstatic" into an object library, but it feels ugly.<br>
<br>
Why would CMake require exporting statically linked dependency targets among the targets that use them? Feels like a bug to me.<br>
<br>
Regards,<br>
-Lassi Niemistö<br>
--<br>
<br>
Powered by </span><a href="http://www.kitware.com"><span lang="EN-US" style="font-size:10.5pt;font-family:"Arial",sans-serif">www.kitware.com</span></a><span lang="EN-US" style="font-size:10.5pt;font-family:"Arial",sans-serif"><br>
<br>
Please keep messages on-topic and check the CMake FAQ at: </span><a href="http://www.cmake.org/Wiki/CMake_FAQ"><span lang="EN-US" style="font-size:10.5pt;font-family:"Arial",sans-serif">http://www.cmake.org/Wiki/CMake_FAQ</span></a><span lang="EN-US" style="font-size:10.5pt;font-family:"Arial",sans-serif"><br>
<br>
Kitware offers various services to support the CMake community. For more information on each offering, please visit:<br>
<br>
CMake Support: </span><a href="http://cmake.org/cmake/help/support.html"><span lang="EN-US" style="font-size:10.5pt;font-family:"Arial",sans-serif">http://cmake.org/cmake/help/support.html</span></a><span lang="EN-US" style="font-size:10.5pt;font-family:"Arial",sans-serif"><br>
CMake Consulting: </span><a href="http://cmake.org/cmake/help/consulting.html"><span lang="EN-US" style="font-size:10.5pt;font-family:"Arial",sans-serif">http://cmake.org/cmake/help/consulting.html</span></a><span lang="EN-US" style="font-size:10.5pt;font-family:"Arial",sans-serif"><br>
CMake Training Courses: </span><a href="http://cmake.org/cmake/help/training.html"><span lang="EN-US" style="font-size:10.5pt;font-family:"Arial",sans-serif">http://cmake.org/cmake/help/training.html</span></a><span lang="EN-US" style="font-size:10.5pt;font-family:"Arial",sans-serif"><br>
<br>
Visit other Kitware open-source projects at </span><a href="http://www.kitware.com/opensource/opensource.html"><span lang="EN-US" style="font-size:10.5pt;font-family:"Arial",sans-serif">http://www.kitware.com/opensource/opensource.html</span></a><span lang="EN-US" style="font-size:10.5pt;font-family:"Arial",sans-serif"><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
</span><a href="https://cmake.org/mailman/listinfo/cmake-developers"><span lang="EN-US" style="font-size:10.5pt;font-family:"Arial",sans-serif">https://cmake.org/mailman/listinfo/cmake-developers</span></a><span lang="EN-US" style="font-size:10.5pt;font-family:"Arial",sans-serif"><o:p></o:p></span></p>
</blockquote>
</div>
</div>
</blockquote>
</div>
</div>
</body>
</html>