From 7abbc676aa0ba9f241aa2b1b9439b7ba1de5563e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20M=C3=BCller?= Date: Tue, 1 Sep 2015 19:38:00 +0200 Subject: [PATCH] cmake-native-dummy.bbclass: initial add MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Some CMake projects make references on executables they create. These references are absolut and therefore CMake complains when using in depending packages. To have a valid reference we create a dummy binary in native sysroot (cross sysroot cannot not contain executables by oe design). Note this will not work for references really used - we do that only for CMake's over enthusiatic behaviour to check all files referenced regardless these files are used or not. Signed-off-by: Andreas Müller --- classes/cmake-native-dummy.bbclass | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 classes/cmake-native-dummy.bbclass diff --git a/classes/cmake-native-dummy.bbclass b/classes/cmake-native-dummy.bbclass new file mode 100644 index 00000000..38da5e3c --- /dev/null +++ b/classes/cmake-native-dummy.bbclass @@ -0,0 +1,22 @@ +# +# Class to create dummy native binaries so cmake can reference them +# Inspired by binconfig-disabled.bbclass +# + +inherit native + +# The list of scripts which should be disabled. +CMAKE_DUMMY_BINARIES ?= "" + +do_install () { + install -d ${D}${bindir} + for x in ${CMAKE_DUMMY_BINARIES}; do + echo "#!/bin/sh" > ${D}${bindir}/$x + # Make the disabled script emit invalid parameters for those configure + # scripts which call it without checking the return code. + echo "echo '--should-not-have-used-$x'" >> ${D}${bindir}/$x + echo "exit 1" >> ${D}${bindir}/$x + chmod 755 ${D}${bindir}/$x + done +} +