[ITK-dev] installed ITK cannot be moved due to absolute path

Dženan Zukić dzenanz at gmail.com
Tue May 10 16:50:03 EDT 2016


Hi Rashad,

a few months ago relative paths were completely removed from CMake, because
they were never fully implemented. Have you followed recommendations from
here <https://itk.org/Wiki/ITK/Cross_Compiling> for cross-compiling?

As for integrating your changes into ITK, you should submit a patch
following the instructions here <https://itk.org/Wiki/ITK/Git/Develop>. If
your changes don't break anything, they are likely to be integrated.

Regards,
Dženan

On Mon, May 9, 2016 at 4:27 PM, Rashad Kanavath <mohammedrashadkm at gmail.com>
wrote:

> Hello all,
>
> I have some issue when copying ITK install directory to a different
> system. I agree this is not usual and may not appear on a linux distro or
> windows.
>
> My requirement is bit different. I cross-compile ITK and then use the
> binaries on Windows. Using dll and headers are fine. But the installed
> cmake files are a problem. They have absolute path in
> ITK-4.8/Modules/*.cmake files. It is not in all .cmake files even though I
> put a wildcard there..
>
> For a easy and quick workaround. I rely on mighty sed command to insert
> something into installed cmake file.
>
> For example see this;
> lib/cmake/ITK-4.8/ITKTargets-release.cmake
>
> set(CMAKE_IMPORT_FILE_VERSION 1)
> set(LIB_INSTALL_PREFIX)
> get_filename_component(CURRENT_FILE_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH)
> get_filename_component(LIB_INSTALL_PREFIX "${CURRENT_FILE_DIR}" PATH)
> get_filename_component(LIB_INSTALL_PREFIX "${LIB_INSTALL_PREFIX}" PATH)
> get_filename_component(LIB_INSTALL_PREFIX "${LIB_INSTALL_PREFIX}" PATH)
>
> and at last:
>
> $(SED) -i 's,$(PREFIX)/$(TARGET),\${LIB_INSTALL_PREFIX},g'
> 'lib/cmake/ITK-$(ITK_VER)/ITKTargets-release.cmake'
>
> I would like to have this patch inside the other .cmake files in the
> installation and avoid the sed commands during post-installation
>
> Here is the list of cmake files that needs this change.
> lib/cmake/ITK-4.8/ITKTargets-release.cmake
> lib/cmake/ITK-4.8/Modules/ITKZLIB.cmake
> lib/cmake/ITK-4.8/Modules/ITKExpat.cmake
> lib/cmake/ITK-4.8/Modules/ITKHDF5.cmake
> lib/cmake/ITK-4.8/Modules/ITKJPEG.cmake
> lib/cmake/ITK-4.8/Modules/ITKTIFF.cmake
> lib/cmake/ITK-4.8/Modules/ITKPNG.cmake
>
> So is it possible to make the change into future version of ITK?
>
> The major issue here is those cmake files are generated by cmake. Is there
> a way cmake could use relative path ?
>
>
> --
> Regards,
>    Rashad
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Kitware offers ITK Training Courses, for more information visit:
> http://kitware.com/products/protraining.php
>
> Please keep messages on-topic and check the ITK FAQ at:
> http://www.itk.org/Wiki/ITK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/insight-developers
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/insight-developers/attachments/20160510/735397bc/attachment.html>


More information about the Insight-developers mailing list