Commit 847d7a80 authored by Dominik Charousset's avatar Dominik Charousset

Add build script for CMake builds in containers

parent 5bef0b1b
#!/bin/sh
set -x
set -e
# This script expects the CAF source tree under 'sources', builds in 'build' and
# installs to 'bundle'. Additionally, the script expects the CMake pre-load
# script 'cmake-init.txt' in the current working directorys.
InitFile="$PWD/cmake-init.txt"
SourceDir="$PWD/sources"
BuildDir="$PWD/build"
cat "$InitFile"
# Prefer cmake3 over "regular" cmake (cmake == cmake2 on RHEL).
if command -v cmake3 >/dev/null 2>&1 ; then
CMakeCommand="cmake3"
CTestCommand="ctest3"
elif command -v cmake >/dev/null 2>&1 ; then
CMakeCommand="cmake"
CTestCommand="ctest"
else
echo "No CMake found."
exit 1
fi
# Make sure all directories exist, then enter build directory.
mkdir -p "$BuildDir"
cd "$BuildDir"
# Run CMake and CTest.
$CMakeCommand -C "$InitFile" "$SourceDir"
if [ -z "$CAF_NUM_CORES" ]; then
$CMakeCommand --build . --target install
else
$CMakeCommand --build . --target install -- -j $CAF_NUM_CORES
fi
$CTestCommand
...@@ -5,7 +5,7 @@ RUN apt update -y && \ ...@@ -5,7 +5,7 @@ RUN apt update -y && \
RUN apt install -y \ RUN apt install -y \
cmake \ cmake \
g++-8 g++-8 \
git \ git \
libssl-dev \ libssl-dev \
make \ make \
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment