[CMake] LOCATION/CMP0026/export/import

Robert Maynard robert.maynard at kitware.com
Wed Nov 7 17:06:59 EST 2018


Looking at CMP0026 more, I believe should be able to read either the
IMPORTED_LOCATION or LOCATION for any import target without triggering
the policy, as the policy only pertains to 'build' targets and not
'import' targets.
On Wed, Nov 7, 2018 at 4:51 PM Hendrik Greving
<hendrik.greving.smi at gmail.com> wrote:
>
> 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.
>
> On Wed, Nov 7, 2018 at 12:36 PM Robert Maynard <robert.maynard at kitware.com> wrote:
>>
>> I believe that IMPORTED_LOCATION is safe to use.
>> On Wed, Nov 7, 2018 at 3:27 PM Hendrik Greving
>> <hendrik.greving.smi at gmail.com> wrote:
>> >
>> > So IMPORTED_LOCATION is obsolete as well? (since reading LOCATION is obsolete)
>> >
>> > On Wed, Nov 7, 2018 at 11:39 AM Robert Maynard <robert.maynard at kitware.com> wrote:
>> >>
>> >> With generator expressions making the reading of  LOCATION non-viable
>> >> during configuration time ( since the actual location is now evaluated
>> >> at generate time ), the general solution is that you need to move your
>> >> LOCATION reading logic also to generate time. In general this means
>> >> using something like file(GENERATE ) to dump the location to disk.
>> >> On Wed, Nov 7, 2018 at 1:05 PM Hendrik Greving
>> >> <hendrik.greving.smi at gmail.com> wrote:
>> >> >
>> >> > Hello,
>> >> >
>> >> > 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?
>> >> >
>> >> > Thanks in advance
>> >> > --
>> >> >
>> >> > Powered by www.kitware.com
>> >> >
>> >> > Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ
>> >> >
>> >> > Kitware offers various services to support the CMake community. For more information on each offering, please visit:
>> >> >
>> >> > CMake Support: http://cmake.org/cmake/help/support.html
>> >> > CMake Consulting: http://cmake.org/cmake/help/consulting.html
>> >> > CMake Training Courses: http://cmake.org/cmake/help/training.html
>> >> >
>> >> > Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
>> >> >
>> >> > Follow this link to subscribe/unsubscribe:
>> >> > https://cmake.org/mailman/listinfo/cmake


More information about the CMake mailing list