<div dir="ltr">Thanks Robert. Too bad that this something I cannot inspect. A list of include directories would be useful even with unexpanded generator expressions.<div><br></div><div>CMake-server mode sounds like an interesting option.</div></div><br><div class="gmail_quote"><div dir="ltr">On Tue, Mar 27, 2018 at 10:47 AM Robert Maynard <<a href="mailto:robert.maynard@kitware.com">robert.maynard@kitware.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">In general your options are to look at the command line or use<br>
cmake-server mode to query the code model. The full set of include<br>
directories is not known while configuring due to generator<br>
expressions expanding after the configure step.<br>
<br>
On Mon, Mar 26, 2018 at 9:45 PM, Saad Khattak <<a href="mailto:saadrustam@gmail.com" target="_blank">saadrustam@gmail.com</a>> wrote:<br>
> Hi,<br>
><br>
> I have many libraries and packages that are being linked using<br>
> target_link_libraries(...) where CMake takes care of the include<br>
> directories. There are cases where I get compile errors because I don't know<br>
> the exact include directories.<br>
><br>
> I thought perhaps I could get the include directories of my target by doing<br>
> the following:<br>
><br>
> get_target_property(INCLUDE_DIRS MyExeThatLinksToManyLibs<br>
> INCLUDE_DIRECTORIES)<br>
> message(STATUS ${INCLUDE_DIRS}) # hoped that this would print all the<br>
> include directories<br>
><br>
> Unfortunately, that did not work as expected. It was missing directories<br>
> that I know are added to the include directories of the target (because the<br>
> compiler is able to find the headers properly).<br>
><br>
> Apart from sifting through the compile commands, is there a nice way to<br>
> debug the include directories of a target?<br>
><br>
> Thank you,<br>
> Saad<br>
><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:<br>
> <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<br>
> 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<br>
> <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>
</blockquote></div>