<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="http://www.w3.org/TR/REC-html40">
<head>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii">
<meta name=Generator content="Microsoft Word 11 (filtered medium)">
<!--[if !mso]>
<style>
v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style>
<![endif]-->
<style>
<!--
/* Font Definitions */
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman";}
a:link, span.MsoHyperlink
        {color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {color:blue;
        text-decoration:underline;}
p
        {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";}
span.EmailStyle18
        {mso-style-type:personal-reply;
        font-family:Arial;
        color:navy;}
@page Section1
        {size:595.3pt 841.9pt;
        margin:72.0pt 90.0pt 72.0pt 90.0pt;}
div.Section1
        {page:Section1;}
-->
</style>
</head>
<body lang=FR link=blue vlink=blue>
<div class=Section1>
<p class=MsoNormal><font size=2 color=navy face=Arial><span lang=EN-GB
style='font-size:10.0pt;font-family:Arial;color:navy'>My question is related to
my post "Working with repositories":<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span lang=EN-GB
style='font-size:10.0pt;font-family:Arial;color:navy'>I want to compile just a
part of the project (a few libs and a few binaries), but when linking binaries,
I still need all dependency informations. I want to get missing libs from a
reference build shared somewhere else.<o:p></o:p></span></font></p>
<div>
<p class=MsoNormal><font size=2 face=Tahoma><span style='font-size:10.0pt;
font-family:Tahoma'><o:p> </o:p></span></font></p>
<div class=MsoNormal align=center style='text-align:center'><font size=3
face="Times New Roman"><span lang=EN-US style='font-size:12.0pt'>
<hr size=2 width="100%" align=center tabindex=-1>
</span></font></div>
<p class=MsoNormal><b><font size=2 face=Tahoma><span lang=EN-US
style='font-size:10.0pt;font-family:Tahoma;font-weight:bold'>From:</span></font></b><font
size=2 face=Tahoma><span lang=EN-US style='font-size:10.0pt;font-family:Tahoma'>
cmake-bounces@cmake.org [mailto:cmake-bounces@cmake.org] <b><span
style='font-weight:bold'>On Behalf Of </span></b>David Cole<br>
<b><span style='font-weight:bold'>Sent:</span></b> Monday, 12 January 2009
16:05<br>
<b><span style='font-weight:bold'>To:</span></b> Alexandre Feblot<br>
<b><span style='font-weight:bold'>Cc:</span></b> cmake@cmake.org<br>
<b><span style='font-weight:bold'>Subject:</span></b> Re: [CMake] add_library
and target_link_libraries indifferentdirectories?</span></font><span
lang=EN-US><o:p></o:p></span></p>
</div>
<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'><o:p> </o:p></span></font></p>
<p class=MsoNormal style='margin-bottom:12.0pt'><font size=3
face="Times New Roman"><span style='font-size:12.0pt'>Really, the
target_link_libraries command for a given lib or exe belongs in the same
CMakeLists.txt file that you call add_library or add_executable from. What is
your reason for wanting to put the list of dependencies somewhere else?<o:p></o:p></span></font></p>
<div>
<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'><o:p> </o:p></span></font></p>
<div>
<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'>On Mon, Jan 12, 2009 at 9:29 AM, Alexandre Feblot <<a
href="mailto:Alexandre.Feblot@thomsonreuters.com">Alexandre.Feblot@thomsonreuters.com</a>>
wrote:<o:p></o:p></span></font></p>
<div link=blue vlink="#606420">
<div>
<p><font size=2 face="Courier New"><span lang=EN-GB style='font-size:10.0pt;
font-family:"Courier New"'>Hi Andreas,</span></font><o:p></o:p></p>
<p><font size=2 face="Courier New"><span lang=EN-GB style='font-size:10.0pt;
font-family:"Courier New"'> </span></font><o:p></o:p></p>
<p><font size=2 face="Courier New"><span lang=EN-GB style='font-size:10.0pt;
font-family:"Courier New"'>In fact, this is already what I did:</span></font><o:p></o:p></p>
<p><font size=2 face="Courier New"><span lang=EN-GB style='font-size:10.0pt;
font-family:"Courier New"'> </span></font><o:p></o:p></p>
<p><font size=2 face="Courier New"><span lang=EN-GB style='font-size:10.0pt;
font-family:"Courier New"'>Here is a synopsis of my CMakeLists files:</span></font><o:p></o:p></p>
<p><font size=2 face="Courier New"><span lang=EN-GB style='font-size:10.0pt;
font-family:"Courier New"'> </span></font><o:p></o:p></p>
<p><font size=2 face="Courier New"><span lang=EN-GB style='font-size:10.0pt;
font-family:"Courier New"'>ROOT CMakeLists.txt:</span></font><o:p></o:p></p>
<p style='margin-left:53.25pt;text-indent:-18.0pt'><font size=2
face="Courier New"><span lang=EN-GB style='font-size:10.0pt;font-family:"Courier New"'>-</span></font><font
size=1><span lang=EN-GB style='font-size:7.0pt'>
</span></font><span lang=EN-GB>define some general stuff, options, macros.</span><o:p></o:p></p>
<p style='margin-left:53.25pt;text-indent:-18.0pt'><font size=2
face="Courier New"><span lang=EN-GB style='font-size:10.0pt;font-family:"Courier New"'>-</span></font><font
size=1><span lang=EN-GB style='font-size:7.0pt'>
</span></font><span lang=EN-GB>call add_subdirectory() for all subdirectories</span><o:p></o:p></p>
<p style='margin-left:53.25pt;text-indent:-18.0pt'><font size=2
face="Courier New"><span lang=EN-GB style='font-size:10.0pt;font-family:"Courier New"'>-</span></font><font
size=1><span lang=EN-GB style='font-size:7.0pt'>
</span></font><span lang=EN-GB>*trying* to set link dependencies with
target_link_libraries()</span><o:p></o:p></p>
<p><font size=2 face="Courier New"><span lang=EN-GB style='font-size:10.0pt;
font-family:"Courier New"'> </span></font><o:p></o:p></p>
<p><font size=2 face="Courier New"><span lang=EN-GB style='font-size:10.0pt;
font-family:"Courier New"'>subdir CMakeLists.txt:</span></font><o:p></o:p></p>
<p><font size=2 face="Courier New"><span lang=EN-GB style='font-size:10.0pt;
font-family:"Courier New"'> - defining libs with
add_library()</span></font><o:p></o:p></p>
<p><font size=2 face="Courier New"><span lang=EN-GB style='font-size:10.0pt;
font-family:"Courier New"'> </span></font><o:p></o:p></p>
<p><font size=2 face="Courier New"><span lang=EN-GB style='font-size:10.0pt;
font-family:"Courier New"'>Or don't I understand what you mean by " before
linking the libs "?</span></font><o:p></o:p></p>
<p><font size=2 face="Courier New"><span lang=EN-GB style='font-size:10.0pt;
font-family:"Courier New"'> </span></font><o:p></o:p></p>
<p><font size=2 color="#888888" face="Courier New"><span lang=EN-GB
style='font-size:10.0pt;font-family:"Courier New";color:#888888'> </span></font><font
color="#888888"><span style='color:#888888'><o:p></o:p></span></font></p>
<p><font size=2 color="#888888" face="Courier New"><span lang=EN-GB
style='font-size:10.0pt;font-family:"Courier New";color:#888888'>Alexandre</span></font><font
color="#888888"><span style='color:#888888'><o:p></o:p></span></font></p>
<div>
<div>
<p><font size=2 face="Courier New"><span lang=EN-GB style='font-size:10.0pt;
font-family:"Courier New"'> </span></font><o:p></o:p></p>
<p><font size=2 face="Courier New"><span lang=EN-US style='font-size:10.0pt;
font-family:"Courier New"'>-----Original Message-----<br>
From: <a href="mailto:cmake-bounces@cmake.org" target="_blank">cmake-bounces@cmake.org</a>
[mailto:<a href="mailto:cmake-bounces@cmake.org" target="_blank">cmake-bounces@cmake.org</a>]
On Behalf Of Andreas Pakulat<br>
Sent: Monday, 12 January 2009 14:32<br>
To: <a href="mailto:cmake@cmake.org" target="_blank">cmake@cmake.org</a><br>
Subject: Re: [CMake] add_library and target_link_libraries in
differentdirectories?</span></font><o:p></o:p></p>
<p><font size=2 face="Courier New"><span lang=EN-GB style='font-size:10.0pt;
font-family:"Courier New"'> </span></font><o:p></o:p></p>
<p><font size=2 face="Courier New"><span style='font-size:10.0pt;font-family:
"Courier New"'>On 12.01.09 11:27:28, Alexandre Feblot wrote:</span></font><o:p></o:p></p>
<p><font size=2 face="Courier New"><span style='font-size:10.0pt;font-family:
"Courier New"'>> Hi,</span></font><o:p></o:p></p>
<p><font size=2 face="Courier New"><span style='font-size:10.0pt;font-family:
"Courier New"'>> </span></font><o:p></o:p></p>
<p><font size=2 face="Courier New"><span style='font-size:10.0pt;font-family:
"Courier New"'>> </span></font><o:p></o:p></p>
<p><font size=2 face="Courier New"><span style='font-size:10.0pt;font-family:
"Courier New"'>> </span></font><o:p></o:p></p>
<p><font size=2 face="Courier New"><span style='font-size:10.0pt;font-family:
"Courier New"'>> I have not been able to define a library dependency in a
directory</span></font><o:p></o:p></p>
<p><font size=2 face="Courier New"><span style='font-size:10.0pt;font-family:
"Courier New"'>> different from the one in which the library target is
created.</span></font><o:p></o:p></p>
<p><font size=2 face="Courier New"><span style='font-size:10.0pt;font-family:
"Courier New"'>> </span></font><o:p></o:p></p>
<p><font size=2 face="Courier New"><span style='font-size:10.0pt;font-family:
"Courier New"'>> Is this done by design, or is there any way to do it?</span></font><o:p></o:p></p>
<p><font size=2 face="Courier New"><span style='font-size:10.0pt;font-family:
"Courier New"'>> </span></font><o:p></o:p></p>
<p><font size=2 face="Courier New"><span style='font-size:10.0pt;font-family:
"Courier New"'>> </span></font><o:p></o:p></p>
<p><font size=2 face="Courier New"><span style='font-size:10.0pt;font-family:
"Courier New"'>> </span></font><o:p></o:p></p>
<p><font size=2 face="Courier New"><span style='font-size:10.0pt;font-family:
"Courier New"'>> My goal would be to have</span></font><o:p></o:p></p>
<p><font size=2 face="Courier New"><span style='font-size:10.0pt;font-family:
"Courier New"'>> </span></font><o:p></o:p></p>
<p><font size=2 face="Courier New"><span style='font-size:10.0pt;font-family:
"Courier New"'>> -
each library in it's own directory (and a CMakeLists.txt file</span></font><o:p></o:p></p>
<p><font size=2 face="Courier New"><span style='font-size:10.0pt;font-family:
"Courier New"'>> with a add_library command)</span></font><o:p></o:p></p>
<p><font size=2 face="Courier New"><span style='font-size:10.0pt;font-family:
"Courier New"'>> </span></font><o:p></o:p></p>
<p><font size=2 face="Courier New"><span style='font-size:10.0pt;font-family:
"Courier New"'>> - all
dependencies stored in a single file at the root level</span></font><o:p></o:p></p>
<p><font size=2 face="Courier New"><span style='font-size:10.0pt;font-family:
"Courier New"'>> </span></font><o:p></o:p></p>
<p><font size=2 face="Courier New"><span style='font-size:10.0pt;font-family:
"Courier New"'> </span></font><o:p></o:p></p>
<p><font size=2 face="Courier New"><span style='font-size:10.0pt;font-family:
"Courier New"'>Then you need to call add_subdirectory() for the library subdirs
before</span></font><o:p></o:p></p>
<p><font size=2 face="Courier New"><span style='font-size:10.0pt;font-family:
"Courier New"'>linking the libs. You can't link a target that you havent'
defined yet.</span></font><o:p></o:p></p>
<p><font size=2 face="Courier New"><span style='font-size:10.0pt;font-family:
"Courier New"'> </span></font><o:p></o:p></p>
<p><font size=2 face="Courier New"><span style='font-size:10.0pt;font-family:
"Courier New"'>Andreas</span></font><o:p></o:p></p>
<p><font size=2 face="Courier New"><span style='font-size:10.0pt;font-family:
"Courier New"'> </span></font><o:p></o:p></p>
<p><font size=2 face="Courier New"><span style='font-size:10.0pt;font-family:
"Courier New"'>-- </span></font><o:p></o:p></p>
<p><font size=2 face="Courier New"><span style='font-size:10.0pt;font-family:
"Courier New"'>Chicken Little was right.</span></font><o:p></o:p></p>
<p><font size=2 face="Courier New"><span style='font-size:10.0pt;font-family:
"Courier New"'>_______________________________________________</span></font><o:p></o:p></p>
<p><font size=2 face="Courier New"><span style='font-size:10.0pt;font-family:
"Courier New"'>CMake mailing list</span></font><o:p></o:p></p>
<p><font size=2 face="Courier New"><span style='font-size:10.0pt;font-family:
"Courier New"'><a href="mailto:CMake@cmake.org" target="_blank">CMake@cmake.org</a></span></font><o:p></o:p></p>
<p><font size=2 face="Courier New"><span style='font-size:10.0pt;font-family:
"Courier New"'><a href="http://www.cmake.org/mailman/listinfo/cmake"
target="_blank">http://www.cmake.org/mailman/listinfo/cmake</a></span></font><o:p></o:p></p>
<p><font size=2 face="Courier New"><span style='font-size:10.0pt;font-family:
"Courier New"'> </span></font><o:p></o:p></p>
</div>
</div>
</div>
<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'><br clear=all>
<o:p></o:p></span></font></p>
<div>
<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'>This email was sent to you by Thomson Reuters, the global news and information
company.<br>
Any views expressed in this message are those of the individual sender, except
where the sender specifically states them to be the views of Thomson Reuters. <o:p></o:p></span></font></p>
</div>
</div>
<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'><br>
_______________________________________________<br>
CMake mailing list<br>
<a href="mailto:CMake@cmake.org">CMake@cmake.org</a><br>
<a href="http://www.cmake.org/mailman/listinfo/cmake" target="_blank">http://www.cmake.org/mailman/listinfo/cmake</a><o:p></o:p></span></font></p>
</div>
<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'><o:p> </o:p></span></font></p>
</div>
</div>
<br clear=all> This email was sent to you by Thomson Reuters, the global news and information company.<br>
Any views expressed in this message are those of the individual sender, except where the sender specifically states them to be the views of Thomson Reuters.
</body>
</html>