[CMake] CPack packaging portable binaries with external shared libraries

Jean-Christophe Fillion-Robin jchris.fillionr at kitware.com
Thu Jun 19 13:39:17 EDT 2014


Hi,

In case, you think about having more than on executable in different folder
or if you will have plugins, I wouldn't recommend using "@executable_path"
instead "@loader_path" is the way to go.

This is discussed here :
http://cmake.3232098.n2.nabble.com/Mac-loader-path-for-rpath-questions-tp7587456p7587710.html

There is also a topic here [1] that would need some love and care ... if
there is some interest, I could rebase the topic but would need help for
other to write test and move forward with integration in CMake proper.

Thanks
Jc

[1] https://github.com/jcfr/CMake/tree/tweak-bundleutilities-for-rpath


On Wed, Jun 18, 2014 at 5:12 PM, Zack Galbreath <zack.galbreath at kitware.com>
wrote:

> On Wed, Jun 18, 2014 at 10:14 AM, Sankhesh Jhaveri <
> sankhesh.jhaveri at kitware.com> wrote:
>
>>
>> Any ideas/suggestions how to properly package Linux archive?
>>
>>
>
>
> This has worked for me in the past:
>
> set(origin "$ORIGIN")
> if (APPLE)
>   set(origin "@executable_path")
> endif()
> set(CMAKE_INSTALL_RPATH "${origin}/../lib:${origin}/")
>
> This was for a project with a typical install tree: the executables in
> bin/ and the libraries in a sibling directory named lib/.  The only other
> trick was to tell fixup_bundle() to ignore the files in the lib/ dir of the
> install tree.  I did this by defining the following function before my call
> to fixup_bundle():
>
> function(gp_resolved_file_type_override resolved_file type_var)
>   if(resolved_file MATCHES "\\.\\./lib")
>     set(${type_var} "local" PARENT_SCOPE)
>   endif()
> endfunction()
>
> --
>
> 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
>



-- 
+1 919 869 8849
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/cmake/attachments/20140619/3bdfcdc5/attachment.html>


More information about the CMake mailing list