<div dir="ltr">Ok, it seems to be IMPORT_LOCATION, not IMPORTED_LOCATION<div>We have a (.cmake) file that shared among things that use it for build targets and external projects for imported targets. Is there a way to find out whether a target is imported or a build target?<br><div><br></div></div></div><br><div class="gmail_quote"><div dir="ltr">On Wed, Nov 7, 2018 at 2:19 PM 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">I am not seeing any cmake errors/warnings when I do so :)<br>
On Wed, Nov 7, 2018 at 5:15 PM Hendrik Greving<br>
<<a href="mailto:hendrik.greving.smi@gmail.com" target="_blank">hendrik.greving.smi@gmail.com</a>> wrote:<br>
><br>
> Ok! Except (see above) I do not think one can actually read IMPORTED_LOCATION, can I?<br>
> Thanks! - again!<br>
><br>
> On Wed, Nov 7, 2018 at 2:07 PM Robert Maynard <<a href="mailto:robert.maynard@kitware.com" target="_blank">robert.maynard@kitware.com</a>> wrote:<br>
>><br>
>> Looking at CMP0026 more, I believe should be able to read either the<br>
>> IMPORTED_LOCATION or LOCATION for any import target without triggering<br>
>> the policy, as the policy only pertains to 'build' targets and not<br>
>> 'import' targets.<br>
>> On Wed, Nov 7, 2018 at 4:51 PM Hendrik Greving<br>
>> <<a href="mailto:hendrik.greving.smi@gmail.com" target="_blank">hendrik.greving.smi@gmail.com</a>> wrote:<br>
>> ><br>
>> > Is IMPORTED_LOCATION a property one can read? I was under the assumption that setting IMPORTED_LOCATION becomes LOCATION (for imported targets). And as such, reading this LOCATION generates the warning. I just tried and it indeed didn't let me read IMPORTED_LOCATION.<br>
>> ><br>
>> > On Wed, Nov 7, 2018 at 12:36 PM Robert Maynard <<a href="mailto:robert.maynard@kitware.com" target="_blank">robert.maynard@kitware.com</a>> wrote:<br>
>> >><br>
>> >> I believe that IMPORTED_LOCATION is safe to use.<br>
>> >> On Wed, Nov 7, 2018 at 3:27 PM Hendrik Greving<br>
>> >> <<a href="mailto:hendrik.greving.smi@gmail.com" target="_blank">hendrik.greving.smi@gmail.com</a>> wrote:<br>
>> >> ><br>
>> >> > So IMPORTED_LOCATION is obsolete as well? (since reading LOCATION is obsolete)<br>
>> >> ><br>
>> >> > On Wed, Nov 7, 2018 at 11:39 AM Robert Maynard <<a href="mailto:robert.maynard@kitware.com" target="_blank">robert.maynard@kitware.com</a>> wrote:<br>
>> >> >><br>
>> >> >> With generator expressions making the reading of LOCATION non-viable<br>
>> >> >> during configuration time ( since the actual location is now evaluated<br>
>> >> >> at generate time ), the general solution is that you need to move your<br>
>> >> >> LOCATION reading logic also to generate time. In general this means<br>
>> >> >> using something like file(GENERATE ) to dump the location to disk.<br>
>> >> >> On Wed, Nov 7, 2018 at 1:05 PM Hendrik Greving<br>
>> >> >> <<a href="mailto:hendrik.greving.smi@gmail.com" target="_blank">hendrik.greving.smi@gmail.com</a>> wrote:<br>
>> >> >> ><br>
>> >> >> > Hello,<br>
>> >> >> ><br>
>> >> >> > w/ LOCATION property made obsolete, how can one read a target's LOCATION for imported targets? Previously, IMPORTED_LOCATION was conveyed for such targets, but reading the LOCATION property of imported targets leads to the same warning as for project targets?<br>
>> >> >> ><br>
>> >> >> > Thanks in advance<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>
</blockquote></div>