<div dir="ltr">Thank you Konstantin. get_target_properties(...) works very well.</div><br><div class="gmail_quote"><div dir="ltr">On Sat, Jan 13, 2018 at 12:06 PM Konstantin Tokarev <<a href="mailto:annulen@yandex.ru">annulen@yandex.ru</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
<br>
13.01.2018, 06:26, "Saad Khattak" <<a href="mailto:saadrustam@gmail.com" target="_blank">saadrustam@gmail.com</a>>:<br>
> Hi,<br>
><br>
> Say I find LibA using find_package(LibA) and I now have access to LibA_DIR, which is the build folder of LibA. Is there a way I can query additional variables, such as LibA's source directory, install directory etc. i.e. variables that are defined by CMake when LibA was being generated/built by CMake?<br>
<br>
If  find_package(LibA) provides you target "LibA" (i.e., cmake code under "if (TARGET LibA)"<br>
condition is being executed), you can query various properties from it and expect them to<br>
have sane values. See documentation on cmake properties.<br>
<br>
If there is no LibA target, it probably means that find_package(LibA) is implemented via<br>
FindLibA.cmake module, and you can only use variables that it sets (usually documented in<br>
the beginning of module)<br>
<br>
><br>
> Thanks,<br>
> Saad<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="https://cmake.org/mailman/listinfo/cmake" rel="noreferrer" target="_blank">https://cmake.org/mailman/listinfo/cmake</a><br>
<br>
<br>
-- <br>
Regards,<br>
Konstantin<br>
</blockquote></div>