Skip to contentSkip to conversation

RFC: CMAKE - support out of tree builds

PATCH Robert Schuster 1 participant 2 messages Mar 12, 2009 – Mar 19, 2009

lore
Share & tools
lore
#0 lore raw

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

classes/cmake.bbclass +16 -4
index 8fd25cd..7907f94 100644
@@ -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
#1 lore raw

Hi,
I am going to push this 2009-03-20 aka tomorrow. Please speak if you do not want it.

Regards
Robert

Quoted 18 lines · Robert Schuster

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

------------------------------------------------------------------------

_______________________________________________
Openembedded-devel mailing list
[email protected]
http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-devel