* RFC: CMAKE - support out of tree builds
@ 2009-03-12 15:49 Robert Schuster
2009-03-19 19:47 ` Robert Schuster
0 siblings, 1 reply; 2+ messages in thread
From: Robert Schuster @ 2009-03-12 15:49 UTC (permalink / raw)
To: openembedded-devel
[-- Attachment #1.1: Type: text/plain, Size: 340 bytes --]
Hi,
I am proposing the attached patch to make it possible to do out-of-tree
builds in OE. Out-of-tree builds should be preferred but I do not want
to look at every recipe if it still works.
OTOH I want to include llvm 2.5 with its new cmake-based build system
which incidentally does *not* permit in-tree builds.
Regards
Robert
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.2: oe-cmake-outoftree.patch --]
[-- Type: text/x-patch; name="oe-cmake-outoftree.patch", Size: 1106 bytes --]
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
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 268 bytes --]
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2009-03-19 19:45 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-03-12 15:49 RFC: CMAKE - support out of tree builds Robert Schuster
2009-03-19 19:47 ` Robert Schuster
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.