<div dir="ltr"><span style="font-size:12.8px">> I'd prefer using the PARENT_SCOPE option here...</span><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px">Jack's initial email continues with "</span><span style="font-size:12.8px">but now the variable is not visible to baz.c" so using PARENT_SCOPE does not meet his requirements.</span></div><div><br></div><div><span style="font-size:12.8px">> which will make the variables available in the parent CMakeLists.txt. </span></div><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px">So does using cache variables.</span></div><div><span style="font-size:12.8px"><br></span></div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Nov 20, 2015 at 3:18 PM, Mark Stijnman <span dir="ltr"><<a href="mailto:mark.stijnman@gmail.com" target="_blank">mark.stijnman@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Thu, Nov 19, 2015 at 11:04 PM, Tamás Kenéz <span dir="ltr"><<a href="mailto:tamas.kenez@gmail.com" target="_blank">tamas.kenez@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><span><div><div>> set(foobarSRCS foo.c bar.c)</div><div>> set(foobarLIBS ${externalLibFound})</div><div>></div><div>> which is what the FAQ entry seems to suggest. However, this variable is not visible to goo.c. Okay, so as an alternative, I can do this:</div><div>></div><div>> set(foobarSRCS foo.c bar.c PARENT_SCOPE), etc.</div></div><div><br></div></span>In similar cases I create CACHE variables:<div><div class="gmail_extra"><div><br></div><div>    set(foobarSRCS foo.c bar.c CACHE INTERNAL "" FORCE)</div><div>    set(foobarLIBS ${externalLibFound} CACHE INTERNAL "" FORCE)</div><div><br></div><div>You can also write a set_cache() macro.</div><div><br></div><div>Tamas</div></div></div></div></blockquote><div><br></div><div>I'd prefer using the PARENT_SCOPE option here, which will make the variables available in the parent CMakeLists.txt. </div><div><div>    set(foobarSRCS foo.c bar.c PARENT_SCOPE)</div><div>    set(foobarLIBS ${externalLibFound} PARENT_SCOPE)</div></div></div></div></div>
<br>--<br>
<br>
Powered by <a href="http://www.kitware.com" rel="noreferrer" target="_blank">www.kitware.com</a><br>
<br>
Please keep messages on-topic and check the CMake FAQ at: <a href="http://www.cmake.org/Wiki/CMake_FAQ" rel="noreferrer" target="_blank">http://www.cmake.org/Wiki/CMake_FAQ</a><br>
<br>
Kitware offers various services to support the CMake community. For more information on each offering, please visit:<br>
<br>
CMake Support: <a href="http://cmake.org/cmake/help/support.html" rel="noreferrer" target="_blank">http://cmake.org/cmake/help/support.html</a><br>
CMake Consulting: <a href="http://cmake.org/cmake/help/consulting.html" rel="noreferrer" target="_blank">http://cmake.org/cmake/help/consulting.html</a><br>
CMake Training Courses: <a href="http://cmake.org/cmake/help/training.html" rel="noreferrer" target="_blank">http://cmake.org/cmake/help/training.html</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" rel="noreferrer" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://public.kitware.com/mailman/listinfo/cmake" rel="noreferrer" target="_blank">http://public.kitware.com/mailman/listinfo/cmake</a><br></blockquote></div><br></div>