<div dir="ltr">Can you provide a small project example that can be used to demonstrate your problem? The specifics of how you are doing things may be important.<br><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Sun, Mar 18, 2018 at 8:12 AM, Saad Khattak <span dir="ltr"><<a href="mailto:saadrustam@gmail.com" target="_blank">saadrustam@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">Hi,<div><br></div><div>ExternalProject_Add builds, generates and installs and thus any generator expressions used will be expanded by the time another library uses it. </div><div><br></div><div>For example, if I add a library LibA using ExternalProject_Add, I can then query the target property INTERFACE_INCLUDE_DIRECTORIES and get the include directory for the library:</div><div><br></div><div>get_target_property(LibA_<wbr>INCLUDE_DIRECTORIES LibA</div><div>  INTERFACE_INCLUDE_DIRECTORIES</div><div>  )</div><div><br></div><div>This allows me to then use the variable LibA_INCLUDE_DIRECTORIES in my CMake include(...) statements. However, with FetchContent, this is no longer possible.</div><div><br></div><div>The reason I would like to query a variable is because at project generation time, I invoke FetchContent only if LibA is not found by find_package(LibA). </div><div><br></div><div>Thus, the include directory for LibA may be in the current build directory (through FetchContent) OR it may be found in the folder where LibA is cloned by the user and generated/built OR an INSTALL of LibA.</div><div><br></div><div>Perhaps I should not be using `get_target_property` to get the a library's include directory? Either way, would like some guidance in solving this issue.</div><div><br></div><div>Thank you,</div><div>Saad</div><div><br></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/<wbr>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/<wbr>support.html</a><br>
CMake Consulting: <a href="http://cmake.org/cmake/help/consulting.html" rel="noreferrer" target="_blank">http://cmake.org/cmake/help/<wbr>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/<wbr>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/<wbr>opensource/opensource.html</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="https://cmake.org/mailman/listinfo/cmake" rel="noreferrer" target="_blank">https://cmake.org/mailman/<wbr>listinfo/cmake</a><br>
<br></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr">Craig Scott<br><div>Melbourne, Australia</div><div><a href="https://crascit.com" target="_blank">https://crascit.com</a><br></div></div></div></div></div></div></div>
</div>