<div dir="ltr"><div><div><div><div><div><div><div><div><div><div><div><div><div>Hello all,<br><br></div>Is there a simple FindITK.cmake which can be used instead of config and targets cmake files?<br><br></div>in my install tree, in ITKTargets-release.Cmake there exists absolute path for include and lib file.<br><br></div>My install tree of ITK does not work on a different machine unless I copy them too exact same directory where I installed on machine.<br><br></div>This goes against portability and it is cmake who is doing this work.<br><br></div>Here is code in ITKTargets-release.cmake <br></div></div></div></div></div><br>set_property(TARGET ITKMetaIO APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE)<br>set_target_properties(ITKMetaIO PROPERTIES<br> IMPORTED_IMPLIB_RELEASE "${_IMPORT_PREFIX}/lib/ITKMetaIO-4.10.lib"<br> IMPORTED_LINK_INTERFACE_LIBRARIES_RELEASE "C:/dashboard/otb/install_sb_x86/lib/zdll.lib;comctl32;wsock32"<br> IMPORTED_LOCATION_RELEASE "${_IMPORT_PREFIX}/bin/ITKMetaIO-4.10.dll"<br> )<br><br></div>see the absolute path to C:/dashboard/otb/install_sb_x86/lib/zdll.lib<br><br></div>so if on a different machine no matter where I copy these cmake files for ITK, I must have zdll.lib in C:/dashboard/otb/install_sb_x86/lib/<br></div>and same goes for fftw, expat etc.. if enabled.<br><div><div><div><br><div><div><div><div><div><div><div><div><div><div><div></div><div>A simple find_package searching for for include and headers is portable than config files. Right now even copying the files on same compiler won't work. <br>But in reality there is no technical issues. <br><br></div><div>Is anyone aware of a better way other than manually updating those absolute path to zdll.lib<br></div><div><div><div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, May 24, 2016 at 1:21 AM, Matt McCormick <span dir="ltr"><<a target="_blank" href="mailto:matt.mccormick@kitware.com">matt.mccormick@kitware.com</a>></span> wrote:<br><blockquote style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex" class="gmail_quote">Hi Rashad,<br>
<br>
It looks like MXE is configured to use system versions of EXPAT, HDF5,<br>
JPEG, PNG, TIFF, and ZLIB:<br>
<br>
<a target="_blank" rel="noreferrer" href="https://github.com/mxe/mxe/blob/4135f9b1227ba56b92ceb8a982016370ad5c8894/src/itk.mk#L28-L33">https://github.com/mxe/mxe/<wbr>blob/<wbr>4135f9b1227ba56b92ceb8a9820163<wbr>70ad5c8894/src/itk.mk#L28-L33</a><br>
<br>
USE_SYSTEM could be disabled for these libraries.<br>
<br>
Or, it may be possible for the module system to learn relative<br>
locations of these libraries with ITK_USE_SYSTEM*. But, it would work<br>
best if these projects were configured with CMake, create a<br>
<project>Config.cmake or <project>-config.cmake file, and use relative<br>
paths internally.<br>
<br>
HTH,<br>
Matt<br>
<br>
On Tue, May 10, 2016 at 5:25 PM, Rashad Kanavath<br>
<div class="gmail-HOEnZb"><div class="gmail-h5"><<a href="mailto:mohammedrashadkm@gmail.com">mohammedrashadkm@gmail.com</a>> wrote:<br>
><br>
><br>
> On Tue, May 10, 2016 at 10:50 PM, Dženan Zukić <<a href="mailto:dzenanz@gmail.com">dzenanz@gmail.com</a>> wrote:<br>
>><br>
>> Hi Rashad,<br>
>><br>
>> a few months ago relative paths were completely removed from CMake,<br>
>> because they were never fully implemented. Have you followed recommendations<br>
>> from here for cross-compiling?<br>
><br>
><br>
> Yes. indeed. I had updated the mxe/src/<a target="_blank" rel="noreferrer" href="http://itk.mk">itk.mk</a> for several versions of ITK!<br>
><br>
> Regarding relative path in cmake, I don't understand. I didn't use cmake<br>
> specific REL_PATH.<br>
>><br>
>><br>
>> As for integrating your changes into ITK, you should submit a patch<br>
>> following the instructions here. If your changes don't break anything, they<br>
>> are likely to be integrated.<br>
><br>
><br>
> issue here is a bit different. For all libitk* stuff the story ends well.<br>
> For thirdparties, zlib, expat etc.. it is good idea to put the full path<br>
> because we don't know if they are in same install directory as ITK or not.<br>
> But this make the installed cmake modules non-portable even to a different<br>
> location on the same disk.<br>
><br>
> Now if anyone want to provide a distributable setup of ITK. patch the<br>
> generated cmake files with sed and then copy it. This is what I am doing<br>
> right now!<br>
> A simple not perfect solution is to have all thirdparties make<br>
> <LIBRARY>_PREFIX variable inside the ITKConfig.cmake<br>
><br>
> and for each library we use <LIBRARY>_PREFIX/include and<br>
> <LIBRARY>_PREFIX/lib<br>
><br>
><br>
> Another option is to avoid full path directly inside cmake module files and<br>
> put find_package() calls in the install tree.<br>
><br>
> As these files are autogenerated by cmake, don't know what is possible.<br>
><br>
><br>
><br>
><br>
><br>
>><br>
>> Regards,<br>
>> Dženan<br>
>><br>
>> On Mon, May 9, 2016 at 4:27 PM, Rashad Kanavath<br>
>> <<a href="mailto:mohammedrashadkm@gmail.com">mohammedrashadkm@gmail.com</a>> wrote:<br>
>>><br>
>>> Hello all,<br>
>>><br>
>>> I have some issue when copying ITK install directory to a different<br>
>>> system. I agree this is not usual and may not appear on a linux distro or<br>
>>> windows.<br>
>>><br>
>>> My requirement is bit different. I cross-compile ITK and then use the<br>
>>> binaries on Windows. Using dll and headers are fine. But the installed cmake<br>
>>> files are a problem. They have absolute path in ITK-4.8/Modules/*.cmake<br>
>>> files. It is not in all .cmake files even though I put a wildcard there..<br>
>>><br>
>>> For a easy and quick workaround. I rely on mighty sed command to insert<br>
>>> something into installed cmake file.<br>
>>><br>
>>> For example see this;<br>
>>> lib/cmake/ITK-4.8/ITKTargets-<wbr>release.cmake<br>
>>><br>
>>> set(CMAKE_IMPORT_FILE_VERSION 1)<br>
>>> set(LIB_INSTALL_PREFIX)<br>
>>> get_filename_component(<wbr>CURRENT_FILE_DIR "${CMAKE_CURRENT_LIST_FILE}"<br>
>>> PATH)<br>
>>> get_filename_component(LIB_<wbr>INSTALL_PREFIX "${CURRENT_FILE_DIR}" PATH)<br>
>>> get_filename_component(LIB_<wbr>INSTALL_PREFIX "${LIB_INSTALL_PREFIX}" PATH)<br>
>>> get_filename_component(LIB_<wbr>INSTALL_PREFIX "${LIB_INSTALL_PREFIX}" PATH)<br>
>>><br>
>>> and at last:<br>
>>><br>
>>> $(SED) -i 's,$(PREFIX)/$(TARGET),\${LIB_<wbr>INSTALL_PREFIX},g'<br>
>>> 'lib/cmake/ITK-$(ITK_VER)/<wbr>ITKTargets-release.cmake'<br>
>>><br>
>>> I would like to have this patch inside the other .cmake files in the<br>
>>> installation and avoid the sed commands during post-installation<br>
>>><br>
>>> Here is the list of cmake files that needs this change.<br>
>>> lib/cmake/ITK-4.8/ITKTargets-<wbr>release.cmake<br>
>>> lib/cmake/ITK-4.8/Modules/<wbr>ITKZLIB.cmake<br>
>>> lib/cmake/ITK-4.8/Modules/<wbr>ITKExpat.cmake<br>
>>> lib/cmake/ITK-4.8/Modules/<wbr>ITKHDF5.cmake<br>
>>> lib/cmake/ITK-4.8/Modules/<wbr>ITKJPEG.cmake<br>
>>> lib/cmake/ITK-4.8/Modules/<wbr>ITKTIFF.cmake<br>
>>> lib/cmake/ITK-4.8/Modules/<wbr>ITKPNG.cmake<br>
>>><br>
>>> So is it possible to make the change into future version of ITK?<br>
>>><br>
>>> The major issue here is those cmake files are generated by cmake. Is<br>
>>> there a way cmake could use relative path ?<br>
>>><br>
>>><br>
>>> --<br>
>>> Regards,<br>
>>> Rashad<br>
>>><br>
>>> ______________________________<wbr>_________________<br>
>>> Powered by <a target="_blank" rel="noreferrer" href="http://www.kitware.com">www.kitware.com</a><br>
>>><br>
>>> Visit other Kitware open-source projects at<br>
>>> <a target="_blank" rel="noreferrer" href="http://www.kitware.com/opensource/opensource.html">http://www.kitware.com/<wbr>opensource/opensource.html</a><br>
>>><br>
>>> Kitware offers ITK Training Courses, for more information visit:<br>
>>> <a target="_blank" rel="noreferrer" href="http://kitware.com/products/protraining.php">http://kitware.com/products/<wbr>protraining.php</a><br>
>>><br>
>>> Please keep messages on-topic and check the ITK FAQ at:<br>
>>> <a target="_blank" rel="noreferrer" href="http://www.itk.org/Wiki/ITK_FAQ">http://www.itk.org/Wiki/ITK_<wbr>FAQ</a><br>
>>><br>
>>> Follow this link to subscribe/unsubscribe:<br>
>>> <a target="_blank" rel="noreferrer" href="http://public.kitware.com/mailman/listinfo/insight-developers">http://public.kitware.com/<wbr>mailman/listinfo/insight-<wbr>developers</a><br>
>>><br>
>><br>
><br>
><br>
><br>
> --<br>
> Regards,<br>
> Rashad<br>
><br>
> ______________________________<wbr>_________________<br>
> Powered by <a target="_blank" rel="noreferrer" href="http://www.kitware.com">www.kitware.com</a><br>
><br>
> Visit other Kitware open-source projects at<br>
> <a target="_blank" rel="noreferrer" href="http://www.kitware.com/opensource/opensource.html">http://www.kitware.com/<wbr>opensource/opensource.html</a><br>
><br>
> Kitware offers ITK Training Courses, for more information visit:<br>
> <a target="_blank" rel="noreferrer" href="http://kitware.com/products/protraining.php">http://kitware.com/products/<wbr>protraining.php</a><br>
><br>
> Please keep messages on-topic and check the ITK FAQ at:<br>
> <a target="_blank" rel="noreferrer" href="http://www.itk.org/Wiki/ITK_FAQ">http://www.itk.org/Wiki/ITK_<wbr>FAQ</a><br>
><br>
> Follow this link to subscribe/unsubscribe:<br>
> <a target="_blank" rel="noreferrer" href="http://public.kitware.com/mailman/listinfo/insight-developers">http://public.kitware.com/<wbr>mailman/listinfo/insight-<wbr>developers</a><br>
><br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br><div class="gmail_signature"><div><font face="arial, helvetica, sans-serif">Regards,<br> Rashad</font></div></div>
</div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div>