aboutsummaryrefslogtreecommitdiffstats
path: root/classes
diff options
context:
space:
mode:
authorSimon Busch <morphis@gravedo.de>2011-05-04 17:25:48 +0200
committerSimon Busch <morphis@gravedo.de>2011-05-05 13:41:15 +0200
commit3b7d83362027fde4f6850533ab83277d95dda961 (patch)
treed9156d1baaa0421fef30c9456c827a9e06ca3b02 /classes
parent085dc5e99abf98772bfb44f3f25320418d500740 (diff)
downloadopenembedded-3b7d83362027fde4f6850533ab83277d95dda961.tar.gz
cmake.bbclass: set the rpath for native binaries build with cmake
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. Please note that this is only done for recipes inheriting the native class! Signed-off-by: Simon Busch <morphis@gravedo.de> Acked-by: Phil Blundell <philb@gnu.org>
Diffstat (limited to 'classes')
-rw-r--r--classes/cmake.bbclass11
1 files changed, 11 insertions, 0 deletions
diff --git a/classes/cmake.bbclass b/classes/cmake.bbclass
index 40fadeab57..e8e485a026 100644
--- a/classes/cmake.bbclass
+++ b/classes/cmake.bbclass
@@ -24,6 +24,13 @@ OECMAKE_CXX_FLAGS ?= "${HOST_CC_ARCH} ${TOOLCHAIN_OPTIONS} ${TARGET_CPPFLAGS} -f
OECMAKE_C_FLAGS_RELEASE ?= "${SELECTED_OPTIMIZATION} -DNDEBUG"
OECMAKE_CXX_FLAGS_RELEASE ?= "${SELECTED_OPTIMIZATION} -DNDEBUG"
+OECMAKE_RPATH ?= ""
+python __anonymous() {
+ # Only set OECMAKE_RPATH if we build a native recipe
+ if bb.data.inherits_class('native', d) and not bb.data.inherits_class('cross', d):
+ bb.data.setVar('OECMAKE_RPATH', '${libdir}', d)
+}
+
cmake_do_generate_toolchain_file() {
# CMake system name must be something like "Linux".
# This is important for cross-compiling.
@@ -44,6 +51,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 ${OECMAKE_RPATH} )" >> ${WORKDIR}/toolchain.cmake
}
addtask generate_toolchain_file after do_patch before do_configure