+projects (1.1-%BUILD%) unstable; urgency=medium
+ * support of cross compile environments with cmake
+ -- Michael Wagner <michael@wagnertech.de> Tue, 12 Jan 2021 22:54:48 +0100
+
projects (1.0-%BUILD%) unstable; urgency=medium
* prebuild in <paket>.build no longer supported
* support of cmake builds
+++ /dev/null
-#!/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
-
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 .
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