Openembedded Core Discussions
 help / color / mirror / Atom feed
From: Richard Purdie <richard.purdie@linuxfoundation.org>
To: Patches and discussions about the oe-core layer
	<openembedded-core@lists.openembedded.org>
Subject: Re: [PATCH 25/30] cmake.bbclass: fix qmake and rpath issues
Date: Tue, 10 May 2011 09:50:25 +0100	[thread overview]
Message-ID: <1305017425.30391.252.camel@rex> (raw)
In-Reply-To: <c0f7ebbe59b32dace3ae8a4a5dab8622b09f895b.1305004776.git.sgw@linux.intel.com>

On Mon, 2011-05-09 at 22:26 -0700, Saul Wold wrote:
> From: Otavio Salvador <otavio@ossystems.com.br>
> 
> Sync with OE at 3b7d83362027fde4f6850533ab83277d95dda961 however
> without changing the way of generating the toolchain file and making
> it branding agnostic.
> 
> Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
> ---
>  meta/classes/cmake.bbclass |   19 +++++++++++++++++--
>  1 files changed, 17 insertions(+), 2 deletions(-)
> 
> diff --git a/meta/classes/cmake.bbclass b/meta/classes/cmake.bbclass
> index a4b0c12..ac7bd62 100644
> --- a/meta/classes/cmake.bbclass
> +++ b/meta/classes/cmake.bbclass
> @@ -24,15 +24,23 @@ 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)
> +}

Firstly, I don't understand why the "not bb.data.inherits_class('cross',
d)" part of the condition is there as I can't think of a case we inherit
native and cross.

Secondly, can you not just set OECMAKE_RPATH = "${libdir}" in
native.bbclass? I dislike having anonymous python doing simple things we
could do more simply although I can understand the desire to do this in
the same file. Perhaps we should use:

OECMAKE_RPATH = ""
OECMAKE_RPATH_virtclass-native = "${libdir}"

which assumes anything would use BBCLASSEXTEND but we're encouraging
that strongly anyway.

We could unconditionally make native.bbclass set the override too...

Cheers,

Richard


>  cmake_do_generate_toolchain_file() {
>  	cat > ${WORKDIR}/toolchain.cmake <<EOF
>  # CMake system name must be something like "Linux".
>  # This is important for cross-compiling.
>  set( CMAKE_SYSTEM_NAME `echo ${SDK_OS} | sed 's/^./\u&/'` )
> +set( CMAKE_SYSTEM_PROCESSOR ${TARGET_ARCH} )
>  set( CMAKE_C_COMPILER ${OECMAKE_C_COMPILER} )
>  set( CMAKE_CXX_COMPILER ${OECMAKE_CXX_COMPILER} )
> -set( CMAKE_C_FLAGS "${OECMAKE_C_FLAGS}" CACHE STRING "poky CFLAGS" )
> -set( CMAKE_CXX_FLAGS "${OECMAKE_CXX_FLAGS}" CACHE STRING "poky CXXFLAGS" )
> +set( CMAKE_C_FLAGS "${OECMAKE_C_FLAGS}" CACHE STRING "CFLAGS" )
> +set( CMAKE_CXX_FLAGS "${OECMAKE_CXX_FLAGS}" CACHE STRING "CXXFLAGS" )
>  set( CMAKE_C_FLAGS_RELEASE "${OECMAKE_C_FLAGS_RELEASE}" CACHE STRING "CFLAGS for release" )
>  set( CMAKE_CXX_FLAGS_RELEASE "${OECMAKE_CXX_FLAGS_RELEASE}" CACHE STRING "CXXFLAGS for release" )
>  
> @@ -43,6 +51,13 @@ set( CMAKE_FIND_ROOT_PATH_MODE_PROGRAM ONLY )
>  set( CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY )
>  set( CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY )
>  
> +# Use qt.conf settings
> +set( ENV{QT_CONF_PATH} ${WORKDIR}/qt.conf )
> +
> +# We need to set the rpath to the correct directory as cmake does not provide any
> +# directory as rpath by default
> +set( CMAKE_INSTALL_RPATH ${OECMAKE_RPATH} )
> +
>  # Use native cmake modules
>  set( CMAKE_MODULE_PATH ${STAGING_DATADIR}/cmake/Modules/ )
>  EOF





  reply	other threads:[~2011-05-10 10:03 UTC|newest]

Thread overview: 45+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-10  5:26 [PATCH 00/30] Consolidated Pull Request for 5/10/2011 Saul Wold
2011-05-10  5:26 ` [PATCH 01/30] qemu-script: Fix qemu seg fault if install Nvidia proprietary driver Saul Wold
2011-05-10  5:26 ` [PATCH 03/30] conf/layer.conf: Use .= to append to BBPATH and =+ for BBFILES Saul Wold
2011-05-10  8:54   ` Richard Purdie
2011-05-10 17:29     ` Khem Raj
2011-05-10 17:56     ` Chris Larson
2011-05-10 18:56       ` Richard Purdie
2011-05-10  5:26 ` [PATCH 02/30] recipes: Replace gconf-dbus with gconf Saul Wold
2011-05-10  5:26 ` [PATCH 04/30] libgalago_0.5.2.bb: Fix compile for uclibc Saul Wold
2011-05-10  5:26 ` [PATCH 05/30] liburcu_0.5.4.bb: Let it build on uclibc targets Saul Wold
2011-05-10  5:26 ` [PATCH 07/30] insane: add micrblaze target info Saul Wold
2011-05-10  5:26 ` [PATCH 06/30] lttng-ust_0.12.bb: Fix compilation on uclibc Saul Wold
2011-05-10  5:26 ` [PATCH 08/30] kernel-arch: add microblaze to valid archs Saul Wold
2011-05-10  5:26 ` [PATCH 09/30] siteinfo: add microblaze target info Saul Wold
2011-05-10  5:26 ` [PATCH 10/30] linux-libc-headers: add microblaze ARCH definition Saul Wold
2011-05-10  5:26 ` [PATCH 12/30] package_rpm: use target vendor information Saul Wold
2011-05-10  5:26 ` [PATCH 13/30] readline: update version Saul Wold
2011-05-10  8:51   ` Richard Purdie
2011-05-10 14:53     ` Adrian Alonso
2011-05-10 14:59       ` Mark Hatle
2011-05-10  5:26 ` [PATCH 11/30] image-mklibs: add microblaze arch support Saul Wold
2011-05-10  5:26 ` [PATCH 15/30] syslinux: improve packaging Saul Wold
2011-05-10  5:26 ` [PATCH 14/30] scripts/oe-setup-builddir: fix typo Saul Wold
2011-05-10  5:26 ` [PATCH 16/30] gnome-doc-utils: Add additional missing -nonet options to xsltproc Saul Wold
2011-05-10  5:26 ` [PATCH 17/30] web-sato: Update for svn -> git transtion Saul Wold
2011-05-10  5:26 ` [PATCH 18/30] gtkhtml2: Update to 1161 Saul Wold
2011-05-10  5:26 ` [PATCH 19/30] linux-yocto: remove non-core (qemu) machine compatibility Saul Wold
2011-05-10  5:26 ` [PATCH 21/30] meta/conf/local.conf.sample: fix mklibs comment line split and typo Saul Wold
2011-05-10  5:26 ` [PATCH 20/30] linux-yocto: error if meta data not present Saul Wold
2011-05-10  5:26 ` [PATCH 23/30] libxkbfile: disable xcb Saul Wold
2011-05-10  5:26 ` [PATCH 22/30] busybox: add support to mdev Saul Wold
2011-05-10  5:26 ` [PATCH 25/30] cmake.bbclass: fix qmake and rpath issues Saul Wold
2011-05-10  8:50   ` Richard Purdie [this message]
2011-05-10 12:42     ` Otavio Salvador
2011-05-10  5:26 ` [PATCH 24/30] insane.bbclass: skip license checksum if LICENSE is "CLOSED" Saul Wold
2011-05-10  5:26 ` [PATCH 27/30] fuse: drop since it is not used by other recipes Saul Wold
2011-05-10  5:26 ` [PATCH 26/30] qmake_base.bbclass: add generate_qt_config_file task Saul Wold
2011-05-10  8:43   ` Richard Purdie
2011-05-10  9:20     ` Koen Kooi
2011-05-10 12:46       ` Otavio Salvador
2011-05-10 13:32         ` Koen Kooi
2011-05-10  5:26 ` [PATCH 29/30] libxmu: Add native function Saul Wold
2011-05-10  5:26 ` [PATCH 28/30] oe/patch.py: Remove series file during Clean() Saul Wold
2011-05-10  5:26 ` [PATCH 30/30] toolchain-qte: include cross-compiler and fix env script Saul Wold
2011-05-10  9:03 ` [PATCH 00/30] Consolidated Pull Request for 5/10/2011 Richard Purdie

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1305017425.30391.252.camel@rex \
    --to=richard.purdie@linuxfoundation.org \
    --cc=openembedded-core@lists.openembedded.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox