2015-08-30 10:41 GMT+02:00 David Froger <[email protected]>:

> Hi,
>
> When CMake exports libraries that depend on system library, absolute path
> to
> these system libraries are hardcoded in CMakefile configuration files.
>
> For example, when building and installing ITK, the file
> lib/cmake/ITK-4.7ITKTargets-release.cmake is installed and contain
> a reference to /usr/lib64/libm.so .
>
> My problem is that I want to build a conda package for ITK on Centos OS
> 5.11,
> then install this ITK package on Ubuntu 14.04, and link with ITK libraries.
>
> But it fails as libm is search in /usr/lib64/libm.so instead of
> /lib/x86_64-linux-gnu/libm.so.6 .
>
> Here is a minimal example to reproduce the problem without ITK:
>     https://github.com/dfroger/gravitation
>
> Is there an way in CMake to export libraries without absolute path to
> dependant system libraries?
>


I guess that you can set INSTALL_RPATH on a particular target that needs it;
see
 http://www.cmake.org/Wiki/CMake_RPATH_handling
and
http://www.cmake.org/cmake/help/v3.0/prop_tgt/INSTALL_RPATH.html
http://www.cmake.org/cmake/help/v3.0/prop_tgt/INSTALL_RPATH_USE_LINK_PATH.html



-- 
Eric
-- 

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:
http://public.kitware.com/mailman/listinfo/cmake

Reply via email to