build-install-run 791 Bytes
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#!/bin/sh

# Usage: ./build-install-run [BUILD_TYPE]

set -e

if [ -z "$1"]; then
  BUILD_TYPE=Debug
else
  BUILD_TYPE=$1
fi

BASEDIR=`readlink -f -- .`
BUILDDIR=${BASEDIR}/build/$BUILD_TYPE
INSTALLDIR=${BASEDIR}/install/$BUILD_TYPE

17
CMAKE_ARGS="-DCMAKE_INSTALL_PREFIX=${INSTALLDIR} -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DKDE_INSTALL_PREFIX_SCRIPT=ON ../.."
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35

# Use ninja instead of make if command is available
if [ -x "$(command -v ninja)" ]; then
  CMAKE_ARGS="${CMAKE_ARGS} -GNinja"
fi

echo "Configuring build in '${BUILDDIR}' ... "
mkdir -p $BUILDDIR
cd $BUILDDIR
cmake $CMAKE_ARGS

echo "Building in '${BUILDDIR}' ... "
cmake --build .

echo "Installing to '${INSTALLDIR}' ... "
cmake --build . --target install

echo "Running KTouch ... "
36
. ${INSTALLDIR}/prefix.sh
37
${INSTALLDIR}/bin/ktouch