[vtk-developers] Link errors after recent check ins

Marcus D. Hanwell marcus.hanwell at kitware.com
Mon Aug 6 12:52:27 EDT 2012


On Mon, Aug 6, 2012 at 10:39 AM, Brad King <brad.king at kitware.com> wrote:
> On 08/06/2012 10:25 AM, Marcus D. Hanwell wrote:
>>> This topic should fix it:
>>>
>>>  http://review.source.kitware.com/#/t/1022
>>>
>> The reason I did this was for projects adding VTK as a subdirectory,
>> we were hoping that they could be added to the export file. I am not
>> clear on why the APPEND mode of export is not as clean (nor did I spot
>> anything in the documentation).
>
> It isn't the APPEND mode so much as invoking the command anywhere
> except the end.  From the export() command documentation:
>
>  http://www.cmake.org/cmake/help/v2.8.8/cmake.html#command:export
>  "Do not set properties that affect the location of a target after
>   passing it to this command."
>
> The safest way to ensure the properties do not change is to call
> export() last.
>
> For projects that have VTK as a subdirectory, do this:
>
>  add_subdirectory(VTK)
>  # ...
>  get_property(VTK_TARGETS GLOBAL PROPERTY VTK_TARGETS)
>  export(TARGETS ${MY_TARGETS} ${VTK_TARGETS}
>         FILE ${MY_BINARY_DIR}/MyTargets.cmake)
>
Sounds good, and because we have this in a global property then I can
see calling export again, with all VTK and ParaView (in this case)
targets.

Thanks,

Marcus



More information about the vtk-developers mailing list