[yocto] error in cmake.bbclass exposed when meta-darwin included

Woodyatt, James james.woodyatt at intel.com
Tue Dec 31 15:30:35 PST 2013


Everyone—

I didn’t quite get it right in my previous patch.  The main problem is
that the expansion of CMAKE_SYSTEM_NAME needs to match one of the .cmake
files in the Modules/Platform directory of the CMake source tree.  There
is a whole slew of Linux-$foo.cmake files in there, but the one that works
for me is Linux.cmake.  Alas, the bitbake.conf file in Poky defines
TARGET_OS="linux${LIBCEXTENSION}${ABIEXTENSION}" which doesn’t work.

The following patch is simpler and probably better:

diff --git a/meta/classes/cmake.bbclass b/meta/classes/cmake.bbclass
index e64c30c..4ef9fca 100644
--- a/meta/classes/cmake.bbclass
+++ b/meta/classes/cmake.bbclass
@@ -35,7 +35,7 @@ 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_NAME "Linux" )
set( CMAKE_SYSTEM_PROCESSOR ${TARGET_ARCH} )
set( CMAKE_C_COMPILER ${OECMAKE_C_COMPILER} )
set( CMAKE_CXX_COMPILER ${OECMAKE_CXX_COMPILER} )



—
james woodyatt <james.woodyatt at intel.com>
Software Architect, New Devices Group




On 12/31/13, 12:50, "Woodyatt, James" <james.woodyatt at intel.com> wrote:

>Everyone‹
>
>Please review the following patch for Poky, which I believe is necessary
>for properly supporting builds where meta-darwin (also probably
>meta-mingw) is included in the Bitbake layer path list.
>
>Explanation: the meta-darwin layer overrides the value of the SDK_OS
>variable with the value of HOST_OS, which is ³darwin² for most builds, and
>this makes everything that uses CMake fail to build properly.  The case
>where I found this is when OpenCV is included from the OpenEmbedded
>meta-oe layer.  The patch below seems to correct an error in the usage of
>the SDK_OS variable within the cmake.bbclass file.
>
>diff --git a/meta/classes/cmake.bbclass b/meta/classes/cmake.bbclass
>index e64c30c..4ef9fca 100644
>--- a/meta/classes/cmake.bbclass
>+++ b/meta/classes/cmake.bbclass
>@@ -35,7 +35,7 @@ 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_NAME `echo ${TARGET_OS} | sed 's/^./\u&/'` )
> set( CMAKE_SYSTEM_PROCESSOR ${TARGET_ARCH} )
> set( CMAKE_C_COMPILER ${OECMAKE_C_COMPILER} )
> set( CMAKE_CXX_COMPILER ${OECMAKE_CXX_COMPILER} )
>
>I tested this with a local build, and I believe this diff should be
>appended to the oecore.patch file in the meta-darwin layer source tree,
>and it should be applied in the appropriate branches of the Poky source
>tree.
>
>
>-- 
>james woodyatt <james.woodyatt at intel.com>
>
>Software Architect, New Devices Group
>
>_______________________________________________
>yocto mailing list
>yocto at yoctoproject.org
>https://lists.yoctoproject.org/listinfo/yocto



More information about the yocto mailing list