[oe] [PATCH] cmake.bbclass: set the rpath for binaries build with cmake to ${libdir}

Simon Busch morphis at gravedo.de
Wed May 4 17:00:24 UTC 2011


On 04.05.2011 18:54, Phil Blundell wrote:
> On Wed, 2011-05-04 at 18:19 +0200, Simon Busch wrote:
>> On 04.05.2011 18:09, Phil Blundell wrote:
>>> On Wed, 2011-05-04 at 17:50 +0200, Simon Busch wrote:
>>>> +# We need to set the rpath to the correct directory as cmake does not provide any
>>>> +# directory as rpath by default
>>>> +  echo "set( CMAKE_INSTALL_RPATH ${libdir} )" >> ${WORKDIR}/toolchain.cmake
>>>
>>> Shouldn't this be inside some kind of guard for native?  You don't want
>>> rpath in target binaries, do you?
>>
>> Thanks for the hint!
>>
>> You mean something like:
>>
>> if not bb.data.inherits_class('native', d)
>>    and not bb.data.inherits_class('cross', d):
> 
> I think you have the sense backwards but yes, that's the general idea.
> Though I must admit I don't quite understand why the rpath setting from
> BUILD_LDFLAGS is not turning up in cmake's final link.  It might be
> worth investigating why that isn't working for you in case this patch is
> just papering over some deeper problem.

I alreay searched through the cmake documentation and it says that the
rpath is set with the content of the CMAKE_INSTALL_RPATH variable. The
default value of CMAKE_INSTALL_RPATH is ""[1]. As currently nothing sets
it to another value the rpath is never set during the build for the
resulting binaries. I send another patch which does the solution
mentioned above the right way.

regards,
Simon

[1]: http://www.cmake.org/Wiki/CMake_RPATH_handling




More information about the Openembedded-devel mailing list