Openembedded Core Discussions
 help / color / mirror / Atom feed
From: "Miroslav Keš" <miroslav.kes@gmail.com>
To: OE-core <openembedded-core@lists.openembedded.org>
Subject: [PATCH v2] cmake: respect ${S} and ${B} patch problem
Date: Thu, 19 Jun 2014 21:39:15 +0200	[thread overview]
Message-ID: <53A33C63.9040209@gmail.com> (raw)
In-Reply-To: <53A0A6D1.7010206@linux.intel.com>

> The cmake.bbclass currently generates the cmake command using the ${S}
> variable as the path where the top most CMakeLists.txt should be found.
> This works OK as along as the CMakeLists.txt is in the top level
> directory of the package source tree.
> But CMake doesn't require the directory tree to be structured that way.
> If the top level CMakeLists.txt is in a subdirectory of the package
> source tree AND the recipe needs to patch a file which is at a higher
> level the OE build is broken.
>
> I would propose to return the OECMAKE_SOURCEPATH variable to the
> cmake.bbclass, pass it to the cmake command as the "path to the CMake
> file", and set its default value to ${S}


On 06/17/14 22:36, Saul Wold wrote:
>
> Can you send this as a proper v2 patch please.
> Thanks
>     Sau!

I'm doing it first time in my life. Hoping I understood the instructions correctly.

Mira

Signed-off-by: Miroslav Kes <miroslav.kes@gmail.com>
---
 meta/classes/cmake.bbclass | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/meta/classes/cmake.bbclass b/meta/classes/cmake.bbclass
index c9c15f3..f762792 100644
--- a/meta/classes/cmake.bbclass
+++ b/meta/classes/cmake.bbclass
@@ -23,6 +23,9 @@ OECMAKE_RPATH ?= ""
 OECMAKE_PERLNATIVE_DIR ??= ""
 OECMAKE_EXTRA_ROOT_PATH ?= ""
 
+# Path to the CMake file to process.
+OECMAKE_SOURCEPATH ?= "${S}"
+
 cmake_do_generate_toolchain_file() {
     cat > ${WORKDIR}/toolchain.cmake <<EOF
 # CMake system name must be something like "Linux".
@@ -65,8 +68,8 @@ EOF
 addtask generate_toolchain_file after do_patch before do_configure
 
 cmake_do_configure() {
-    if [ "${OECMAKE_BUILDPATH}" -o "${OECMAKE_SOURCEPATH}" ]; then
-        bbnote "cmake.bbclass no longer uses OECMAKE_SOURCEPATH and OECMAKE_BUILDPATH.  The default behaviour is now out-of-tree builds with B=WORKDIR/build."
+    if [ "${OECMAKE_BUILDPATH}" ]; then
+        bbnote "cmake.bbclass no longer uses OECMAKE_BUILDPATH.  The default behaviour is now out-of-tree builds with B=WORKDIR/build."
     fi
 
     if [ "${S}" != "${B}" ]; then
@@ -84,7 +87,7 @@ cmake_do_configure() {
 
     cmake \
       ${OECMAKE_SITEFILE} \
-      ${S} \
+      ${OECMAKE_SOURCEPATH} \
       -DCMAKE_INSTALL_PREFIX:PATH=${prefix} \
       -DCMAKE_INSTALL_BINDIR:PATH=${bindir} \
       -DCMAKE_INSTALL_SBINDIR:PATH=${sbindir} \
-- 
1.8.5.5




  reply	other threads:[~2014-06-19 19:39 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-13 16:33 cmake: respect ${S} and ${B} patch problem Miroslav Keš
2014-06-13 16:38 ` Burton, Ross
2014-06-13 16:51   ` Miroslav Keš
2014-06-17 20:20   ` Miroslav Keš
2014-06-17 20:36     ` Saul Wold
2014-06-19 19:39       ` Miroslav Keš [this message]
2014-06-24 20:23         ` [PATCH v2] " Burton, Ross
2014-06-17 21:21     ` Burton, Ross

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=53A33C63.9040209@gmail.com \
    --to=miroslav.kes@gmail.com \
    --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