<html v="urn:schemas-microsoft-com:vml" o="urn:schemas-microsoft-com:office:office" w="urn:schemas-microsoft-com:office:word" m="http://schemas.microsoft.com/office/2004/12/omml"><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:"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:#0563C1;
 text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
 {mso-style-priority:99;
 color:#954F72;
 text-decoration:underline;}
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.EmailStyle18
 {mso-style-type:personal-reply;
 font-family:"Calibri",sans-serif;
 color:#1F497D;}
.MsoChpDefault
 {mso-style-type:export-only;
 font-family:"Calibri",sans-serif;}
@page WordSection1
 {size:612.0pt 792.0pt;
 margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
 {page:WordSection1;}
--></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="EN-US" link="#0563C1" vlink="#954F72">INTERFACE_LINK_LIBRARIES won't work since it won't pull out include path for dependants.<br>
<br>
Using target_link_libraries() on the imported lib does not work because "it is not built".<br>
<br>
So the question remains open : how to represent include and link dependencies between 2 imported libs ?<br>
<br>
With regards,<br>
<br>
David<br>
<br>
PS : as to why I had to have 2 stages (A_imported and A), this is because I wanted to add an alias which is not possible on an imported target<br><br><div class="gmail_quote">Le 7 avril 2017 12:32:52 GMT+01:00, David Jobet <david.jobet@free.fr> a écrit :<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
Well not quite.<br />
I tried that, but my current definition is rather<br />
Target_link_libraries(B interface B_imported)<br />
<br />
I don't remember for which reason I had to do it in 2 stages like that (the A/A_imported and B/B_imported versions)<br />
<br />
If I add A in the list to read :<br />
Target_link_libraries(B interface B_imported A)<br />
<br />
Then linking against B does add B_imported and A, but it does not keep the link order and might put B_imported before A on the command line.<br />
<br />
I'll try with property INTERFACE_LINK_LIBRARIES instead, and will also try to remove those 2 stages...<br />
<br />
With regards<br />
<br />
David<br /><br /><div class="gmail_quote">Le 6 avril 2017 05:11:46 GMT+01:00, Dvir Yitzchaki <Dvir.Yitzchaki@ceva-dsp.com> a écrit :<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">


<div class="WordSection1">
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D">target_link_libraries(B INTERFACE A)<p></p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D"><p> </p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D">Regards,<p></p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D">Dvir<p></p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D"><p> </p></span></p>
<p class="MsoNormal"><b><span style="font-size:11.0pt;font-family:"Calibri",sans-serif">From:</span></b><span style="font-size:11.0pt;font-family:"Calibri",sans-serif"> CMake [mailto:cmake-bounces@cmake.org]
<b>On Behalf Of </b>David Jobet<br />
<b>Sent:</b> Wednesday, April 5, 2017 18:34<br />
<b>To:</b> cmake@cmake.org<br />
<b>Subject:</b> [CMake] Transitive include and link libraries on imported targets ?<p></p></span></p>
<p class="MsoNormal"></p><p> </p>
<p class="MsoNormal">Hello,<br />
<br />
Let's say I build some external libs A and B with B depending on A.<br />
B and A do not use cmake, so I build them and install them in a 3rdparty directory. I now have access to includes and libs.<br />
I then create some cmake file to describe those libs so I can use them in my project :<br />
Add_library(A_imported STATIC imported)<br />
Set_property(TARGET A_imported APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES 3rdparty/include/A)<br />
Set_property(TARGET A_imported APPEND PROPERTY IMPORTED_LOCATION 3rdparty/libs/libA.a)<br />
Add_library(A INTERFACE)<br />
Target_link_library(A INTERFACE A_imported)<br />
<br />
Same thing for B<br />
<br />
Now let's say I create a top-level target T that depends on B. Compilation might fail because B might include files from A and A is currently not a dependency of T.<br />
<br />
I can fix it in 2 ways :<br />
1- add A as a dependency of T, but I will need to do it on all my Ts<br />
2- somehow make B have transitive dependencies for include and link on A. That would be my prefered choice... But I don't know how to do it.<br />
<br />
Is it possible ? How ?<br />
<br />
Tx for your help.<br />
<br />
David</p><p></p>
</div>

</blockquote></div><br /></blockquote></div><br>
-- <br>
Envoyé de mon appareil Android avec Courriel K-9 Mail. Veuillez excuser ma brièveté.</body></html>