[CMake] Buils executable vs Installed executable

Sergio Vera sergio.vera at alma3d.com
Tue Feb 17 05:02:52 EST 2015


Thanks Nils,

It makes perfect sense with your explanation! Did not know anything about
this RPATH family of variables before.

Cheers and thanks again

On Fri, Feb 13, 2015 at 11:28 AM, Nils Gladitz <nilsgladitz at gmail.com>
wrote:

> On 02/12/2015 06:40 PM, Sergio Vera wrote:
>
>> Dear CMake users,
>>
>> I'm developing an app using CMake in Fedora 20 and so far it's working
>> properly in the build directory.
>> However, I've recently added some Install target commands so I can
>> prepare it for packaging with CPack.
>> However, when I "make install" my app, the application no longer runs
>> and complains about missing shared libraries.
>>
>> With ldd I can see that the binary in my build dir do references system
>> libraries and my 3rd party dependencies, which I have built with cmake
>> too (CTK and VTK)
>>
>> However my Install folder binary does  not list any shared library to my
>> CTK or VTK libs.
>>
>> I'm a bit puzzled by this behavior... Copying the build binary to the
>> install folder works, but still I would like to know what is missing here.
>>
>
> The default behavior on Linux is that CMake manages two sets of RPATHs;
> build time and install time.
>
> The build time RPATHs are autogenerated to conveniently allow you to run
> your binaries from your build tree.
>
> At installation time the build time RPATHs are replaced with installation
> time RPATHs (which per default are empty).
>
> This is since when you deploy your applications you don't normally want
> RPATHs that refer to locations which are only valid on your own development
> system.
>
> You can adjust the behavior with the CMake variables that have RPATH in
> their name [1].
>
> Assuming you only intend to deploy locally and your shared libraries
> aren't being added to the installation itself INSTALL_RPATH_USE_LINK_PATH
> [2]  might be what you are looking for.
>
> Nils
>
> [1] http://www.cmake.org/cmake/help/v3.1/manual/cmake-variables.7.html
>
> [2] http://www.cmake.org/cmake/help/v3.1/variable/CMAKE_
> INSTALL_RPATH_USE_LINK_PATH.html
>



-- 
Sergio Vera

 Alma IT Systems
 C/ Vilana, 4B, 4º 1ª
 08022 Barcelona
 T. (+34) 932 380 592
 www.alma3d.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/cmake/attachments/20150217/cdc9b7ca/attachment.html>


More information about the CMake mailing list