From 9b2f0a49f8779366665b0fbfdf531e48786a1f86 Mon Sep 17 00:00:00 2001 From: Michael Wagner Date: Fri, 22 Jan 2021 23:37:00 +0100 Subject: [PATCH] cpp-d1064d --- debian/mbuild.changelog | 4 ++++ tools/make/cmake_check | 24 ------------------------ tools/make/mconfigure | 32 ++++++++++++++++++++++++++------ 3 files changed, 30 insertions(+), 30 deletions(-) delete mode 100755 tools/make/cmake_check diff --git a/debian/mbuild.changelog b/debian/mbuild.changelog index dde0f6b..35c75c3 100644 --- a/debian/mbuild.changelog +++ b/debian/mbuild.changelog @@ -1,3 +1,7 @@ +projects (1.1-%BUILD%) unstable; urgency=medium + * support of cross compile environments with cmake + -- Michael Wagner Tue, 12 Jan 2021 22:54:48 +0100 + projects (1.0-%BUILD%) unstable; urgency=medium * prebuild in .build no longer supported * support of cmake builds diff --git a/tools/make/cmake_check b/tools/make/cmake_check deleted file mode 100755 index 22f6eb4..0000000 --- a/tools/make/cmake_check +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/bash -set -e -cd ../build -if [ -e debian/$paket.cmake ] -then - # do checks - if [ -e debian/$paket.build ] - then - echo "cmake is not compatible with other builds. Remove $paket.build" - exit 1 - fi - if [ -e debian/$paket.prebuild ] - then - echo "cmake is not compatible with other builds. Remove $paket.prebuild" - exit 2 - fi - - cp debian/$paket.cmake CMakeLists.txt - echo "make" > debian/$paket.build - chmod 755 debian/$paket.build - echo "cmake ." > debian/$paket.prebuild - chmod 755 debian/$paket.prebuild -fi - diff --git a/tools/make/mconfigure b/tools/make/mconfigure index ec5d2a6..adea0e3 100755 --- a/tools/make/mconfigure +++ b/tools/make/mconfigure @@ -26,6 +26,14 @@ function cmake_check { fi cp debian/$paket.cmake CMakeLists.txt + + if [ -n "$cross" ] + then + # inject cross toolset + echo "set (CMAKE_MODULE_PATH $cross)" >> CMakeLists.txt + echo "include(toolset)" >> CMakeLists.txt + fi + echo "make" > debian/$paket.build chmod 755 debian/$paket.build cmake . @@ -175,18 +183,30 @@ then echo "" > debian/rules.pre if [ -e debian/setenv.sh ]; then rm debian/setenv.sh; fi - if [ -n "$ARCH" ] - then - arch_opt="-a $ARCH" - fi if [ -n "$cross" ] then if [ ${cross:0:1} != "/" ] then cross="/opt/cross/$cross" + #export $cross fi - . "$cross/setenv.sh" - cp $cross/setenv.sh debian/setenv.sh + if [ -f "$cross/setenv.sh" ] + then + . "$cross/setenv.sh" + cp $cross/setenv.sh debian/setenv.sh + fi + if [ -z "$ARCH" ] + then + # determine architecture + GNU_ARCH=${cross%-*} # assumed format: DEB_HOST_GNU_TYPE-g++version, e.g. arm-linux-gnueabihf-4.9 + GNU_ARCH=${GNU_ARCH##*/} + arch_opt="-t $GNU_ARCH" + fi + fi + + if [ -n "$ARCH" ] + then + arch_opt="-a $ARCH" fi dpkg-architecture $arch_opt >> debian/setenv.sh -- 2.20.1