]> code.ossystems Code Review - openembedded-core.git/commitdiff
cmake.bbclass: restore OECMAKE_SOURCEPATH
authorRoss Burton <ross.burton@intel.com>
Tue, 24 Jun 2014 20:21:32 +0000 (21:21 +0100)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Wed, 25 Jun 2014 10:49:37 +0000 (11:49 +0100)
Some packages put their CMakeLists.txt file in a subdirectory, so assuming that
it is in ${S} won't work.

Restore OECMAKE_SOURCEPATH (defaulting to ${S}) so that the location of
CMakeLists.txt can be set if required.

Based on a patch by Miroslav Keš <miroslav.kes@gmail.com>

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/classes/cmake.bbclass

index c9c15f30766bf92c31140d87e90d7e78dcab317c..ab2adec782edffd4d59398a69379e8c038dd148d 100644 (file)
@@ -1,3 +1,6 @@
+# Path to the CMake file to process.
+OECMAKE_SOURCEPATH ?= "${S}"
+
 DEPENDS_prepend = "cmake-native "
 B = "${WORKDIR}/build"
 
@@ -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} \