[oe] [PATCH] Add toolchain file generation to cmake bbclass

Valentin Longchamp valentin.longchamp at epfl.ch
Tue Aug 25 15:48:29 UTC 2009


Holger Hans Peter Freyther wrote:
> On Tuesday 25 August 2009 11:07:47 Valentin Longchamp wrote:
>> Matthew Dombroski wrote:
>>> It is possible to make cmake use a toolchain file that defines flags,
>>> search
>>> paths and any other cmake options.
>>>
>>> The main reason for making openembedded generate a toolchain file is
>>> to enable the building of complex packages. Without it a package
>>> requiring Qt4 or boost (or one of many other packages) probably wont find
>>> the right libs and won't build properly.
>> I have had no problem with boost and with Qt4, I have been able to
>> achieve similar results without the toolchain file, only by using a
>> qt.conf file as Zecke had suggested to me.
> 
> Hey,
> 
> could you come up with a patch or help me to work on a patch?

With great pleasure.

I have already posted the recipe I use for qt4/cmake build, the 
FindQt4.cmake module patch is the same Matthew posted earlier today, and 
here is my cmake patch.

Don't hesitate to ask if you need more info (I'll try to be on IRC, 
Longfield)

Val

 From 290226efcab3375808924efb03d264534ab97984 Mon Sep 17 00:00:00 2001
From: Valentin Longchamp <valentin.longchamp at epfl.ch>
Date: Thu, 18 Jun 2009 18:49:04 +0200
Subject: [PATCH 1/1] render cmake search path stricter

The search is only done in the STAGING directy: all the needed tools
should be there (already built) and all the libs and header are there
too. With this, we are sure that we do not mix with the host libs,
headers or tools.

Signed-off-by: Valentin Longchamp <valentin.longchamp at epfl.ch>
---
  classes/cmake.bbclass |    5 ++++-
  1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/classes/cmake.bbclass b/classes/cmake.bbclass
index b5b7b86..08a4ab5 100644
--- a/classes/cmake.bbclass
+++ b/classes/cmake.bbclass
@@ -20,7 +20,10 @@ cmake_do_configure() {

    cmake ${OECMAKE_SOURCEPATH} \
      -DCMAKE_INSTALL_PREFIX:PATH=${prefix} \
-    -DCMAKE_FIND_ROOT_PATH=${STAGING_DIR_HOST} \
+    -DCMAKE_FIND_ROOT_PATH="${STAGING_DIR_HOST};${STAGING_DIR_NATIVE}" \
+    -DCMAKE_FIND_ROOT_PATH_MODE_PROGRAM=BOTH \
+    -DCMAKE_FIND_ROOT_PATH_MODE_LIBRARY=ONLY \
+    -DCMAKE_FIND_ROOT_PATH_MODE_INCLUDE=ONLY \
      ${EXTRA_OECMAKE} \
      -Wno-dev
  }
-- 
1.6.0.4






More information about the Openembedded-devel mailing list