[oe-commits] Robert Schuster : cmake.bbclass: Allow out of tree builds with cmake.
GIT User account
git at amethyst.openembedded.net
Fri Mar 20 13:58:04 UTC 2009
Module: openembedded.git
Branch: org.openembedded.dev
Commit: a17689c0c413caa2e59303f5a4fab0267200ea2f
URL: http://gitweb.openembedded.net/?p=openembedded.git&a=commit;h=a17689c0c413caa2e59303f5a4fab0267200ea2f
Author: Robert Schuster <rschus at entw2.(none)>
Date: Fri Mar 20 13:18:02 2009 +0100
cmake.bbclass: Allow out of tree builds with cmake.
---
classes/cmake.bbclass | 20 ++++++++++++++++----
1 files changed, 16 insertions(+), 4 deletions(-)
diff --git a/classes/cmake.bbclass b/classes/cmake.bbclass
index 8fd25cd..7907f94 100644
--- a/classes/cmake.bbclass
+++ b/classes/cmake.bbclass
@@ -3,13 +3,25 @@ DEPENDS += " cmake-native "
# We want the staging and installing functions from autotools
inherit autotools
+# Use in-tree builds by default but allow this to be changed
+# since some packages do not support them (e.g. llvm 2.5).
OECMAKE_SOURCEPATH ?= "."
+# If declaring this, make sure you also set EXTRA_OEMAKE to
+# "-C ${OECMAKE_BUILDPATH}". So it will run the right makefiles.
+OECMAKE_BUILDPATH ?= ""
+
cmake_do_configure() {
- cmake ${OECMAKE_SOURCEPATH} \
- -DCMAKE_INSTALL_PREFIX:PATH=${prefix} -Wno-dev \
- -DCMAKE_FIND_ROOT_PATH=${STAGING_DIR_HOST} \
- ${EXTRA_OECMAKE}
+ if [ ${OECMAKE_BUILDPATH} ]
+ then
+ mkdir ${OECMAKE_BUILDPATH}
+ cd ${OECMAKE_BUILDPATH}
+ fi
+
+ cmake ${OECMAKE_SOURCEPATH} \
+ -DCMAKE_INSTALL_PREFIX:PATH=${prefix} -Wno-dev \
+ -DCMAKE_FIND_ROOT_PATH=${STAGING_DIR_HOST} \
+ ${EXTRA_OECMAKE}
}
EXPORT_FUNCTIONS do_configure
More information about the Openembedded-commits
mailing list