<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On 4 February 2016 at 04:45, Adam Rankin <span dir="ltr"><<a href="mailto:arankin@robarts.ca" target="_blank">arankin@robarts.ca</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">





<div lang="EN-US" link="#0563C1" vlink="#954F72">
<div>
<p class="MsoNormal">Hello all,<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">I am trying to sort out a project with multiple layers of dependencies and I am trying to figure out the “right” way of configuring things.<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">First easy question: Should a value xyz_LIBRARIES contain target names, or library file locations?</p></div></div></blockquote><div><br></div><div>Preferably target names, assuming you mean imported targets (see answer to next question).</div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div lang="EN-US" link="#0563C1" vlink="#954F72"><div><p class="MsoNormal"><u></u><u></u></p>
<p class="MsoNormal"><u></u> Second question: Should a FindXYZ.cmake file add imported targets, or should a USE_xyz variable be created for later inclusion? (what if the project does not export its targets?)</p></div></div></blockquote><div><br></div><div>Imported targets will be better for end users/developers. An imported target can provide not just the library file location, it can also provide other dependencies such as dependent libraries that also must be linked, header search paths, etc. Furthermore, with an imported target you can explicitly control what other targets are affected by these dependencies simply by linking against your imported target. If you chose the USE_xyz variable + include approach, then the include file will typically end up calling  link_libraries(), link_directories() and/or include_directories() commands and making those things apply to all targets defined thereafter, which used to be the norm but is no longer necessary with all the target_xxx() commands added in more recent versions of CMake (well, 2.8.11 or later).</div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div lang="EN-US" link="#0563C1" vlink="#954F72"><div><p class="MsoNormal"><u></u></p>
<p class="MsoNormal"><u></u> Third question: How’s your day going today?</p></div></div></blockquote><div><br></div><div>Ask me again after the coffee kicks in. :P</div><div><br></div><div><br></div></div>-- <br><div class="gmail_signature"><div dir="ltr"><div>Craig Scott<br>Melbourne, Australia</div><div><a href="http://crascit.com" target="_blank">http://crascit.com</a></div></div></div>
</div></div>