<div dir="ltr"><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small">Hi Rashad,</div><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small"><br></div><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small">one way to generate install tree in a different location is by changing CMAKE_INSTALL_PREFIX in CMake, reconfiguring, regenerating project, the building the INSTALL target. That should generate the install tree in your desired location.</div><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small"><br></div><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small">Regards,</div><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small">Dženan</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Dec 20, 2016 at 4:48 AM, Rashad Kanavath <span dir="ltr"><<a href="mailto:mohammedrashadkm@gmail.com" target="_blank">mohammedrashadkm@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><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(<wbr>ITKMetaIO PROPERTIES<br>  IMPORTED_IMPLIB_RELEASE "${_IMPORT_PREFIX}/lib/<wbr>ITKMetaIO-4.10.lib"<br>  IMPORTED_LINK_INTERFACE_<wbr>LIBRARIES_RELEASE "C:/dashboard/otb/install_sb_<wbr>x86/lib/zdll.lib;comctl32;<wbr>wsock32"<br>  IMPORTED_LOCATION_RELEASE "${_IMPORT_PREFIX}/bin/<wbr>ITKMetaIO-4.10.dll"<br>  )<br><br></div>see the absolute path to C:/dashboard/otb/install_sb_<wbr>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_<wbr>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"><div><div class="h5"><br><div class="gmail_quote">On Tue, May 24, 2016 at 1:21 AM, Matt McCormick <span dir="ltr"><<a href="mailto:matt.mccormick@kitware.com" target="_blank">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 rel="noreferrer" href="https://github.com/mxe/mxe/blob/4135f9b1227ba56b92ceb8a982016370ad5c8894/src/itk.mk#L28-L33" target="_blank">https://github.com/mxe/mxe/blo<wbr>b/4135f9b1227ba56b92ceb8a98201<wbr>6370ad5c8894/src/itk.mk#L28-<wbr>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="m_7378214014056782767gmail-HOEnZb"><div class="m_7378214014056782767gmail-h5"><<a href="mailto:mohammedrashadkm@gmail.com" target="_blank">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" target="_blank">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 rel="noreferrer" href="http://itk.mk" target="_blank">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" target="_blank">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-r<wbr>elease.cmake<br>
>>><br>
>>> set(CMAKE_IMPORT_FILE_VERSION 1)<br>
>>> set(LIB_INSTALL_PREFIX)<br>
>>> get_filename_component(CURRENT<wbr>_FILE_DIR "${CMAKE_CURRENT_LIST_FILE}"<br>
>>> PATH)<br>
>>> get_filename_component(LIB_INS<wbr>TALL_PREFIX "${CURRENT_FILE_DIR}" PATH)<br>
>>> get_filename_component(LIB_INS<wbr>TALL_PREFIX "${LIB_INSTALL_PREFIX}" PATH)<br>
>>> get_filename_component(LIB_INS<wbr>TALL_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)/ITKT<wbr>argets-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-r<wbr>elease.cmake<br>
>>> lib/cmake/ITK-4.8/Modules/ITKZ<wbr>LIB.cmake<br>
>>> lib/cmake/ITK-4.8/Modules/ITKE<wbr>xpat.cmake<br>
>>> lib/cmake/ITK-4.8/Modules/ITKH<wbr>DF5.cmake<br>
>>> lib/cmake/ITK-4.8/Modules/ITKJ<wbr>PEG.cmake<br>
>>> lib/cmake/ITK-4.8/Modules/ITKT<wbr>IFF.cmake<br>
>>> lib/cmake/ITK-4.8/Modules/ITKP<wbr>NG.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 rel="noreferrer" href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
>>><br>
>>> Visit other Kitware open-source projects at<br>
>>> <a rel="noreferrer" href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensou<wbr>rce/opensource.html</a><br>
>>><br>
>>> Kitware offers ITK Training Courses, for more information visit:<br>
>>> <a rel="noreferrer" href="http://kitware.com/products/protraining.php" target="_blank">http://kitware.com/products/pr<wbr>otraining.php</a><br>
>>><br>
>>> Please keep messages on-topic and check the ITK FAQ at:<br>
>>> <a rel="noreferrer" href="http://www.itk.org/Wiki/ITK_FAQ" target="_blank">http://www.itk.org/Wiki/ITK_FA<wbr>Q</a><br>
>>><br>
>>> Follow this link to subscribe/unsubscribe:<br>
>>> <a rel="noreferrer" href="http://public.kitware.com/mailman/listinfo/insight-developers" target="_blank">http://public.kitware.com/mail<wbr>man/listinfo/insight-developer<wbr>s</a><br>
>>><br>
>><br>
><br>
><br>
><br>
> --<br>
> Regards,<br>
>    Rashad<br>
><br>
> ______________________________<wbr>_________________<br>
> Powered by <a rel="noreferrer" href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
><br>
> Visit other Kitware open-source projects at<br>
> <a rel="noreferrer" href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensou<wbr>rce/opensource.html</a><br>
><br>
> Kitware offers ITK Training Courses, for more information visit:<br>
> <a rel="noreferrer" href="http://kitware.com/products/protraining.php" target="_blank">http://kitware.com/products/pr<wbr>otraining.php</a><br>
><br>
> Please keep messages on-topic and check the ITK FAQ at:<br>
> <a rel="noreferrer" href="http://www.itk.org/Wiki/ITK_FAQ" target="_blank">http://www.itk.org/Wiki/ITK_FA<wbr>Q</a><br>
><br>
> Follow this link to subscribe/unsubscribe:<br>
> <a rel="noreferrer" href="http://public.kitware.com/mailman/listinfo/insight-developers" target="_blank">http://public.kitware.com/mail<wbr>man/listinfo/insight-developer<wbr>s</a><br>
><br>
</div></div></blockquote></div><br><br clear="all"><br></div></div><span class="HOEnZb"><font color="#888888">-- <br><div class="m_7378214014056782767gmail_signature"><div><font face="arial, helvetica, sans-serif">Regards,<br>   Rashad</font></div></div>
</font></span></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div>
</blockquote></div><br></div>