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

Simon Busch morphis at gravedo.de
Wed May 4 15:50:28 UTC 2011


In the default configuration cmake does not set a rpath for its builded binaries. This
leads to errors at runtime when the binaries not find their needed runtime libraries.

Signed-off-by: Simon Busch <morphis at gravedo.de>
---
 classes/cmake.bbclass |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/classes/cmake.bbclass b/classes/cmake.bbclass
index 40fadea..5f7066b 100644
--- a/classes/cmake.bbclass
+++ b/classes/cmake.bbclass
@@ -44,6 +44,10 @@ cmake_do_generate_toolchain_file() {
   echo "set( CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY )" >> ${WORKDIR}/toolchain.cmake
 # Use qt.conf settings
   echo "set( ENV{QT_CONF_PATH} ${WORKDIR}/qt.conf )" >> ${WORKDIR}/toolchain.cmake
+
+# 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
 }
 
 addtask generate_toolchain_file after do_patch before do_configure
-- 
1.7.4.1





More information about the Openembedded-devel mailing list