Commit bea9d4df authored by Sebastian Gottfried's avatar Sebastian Gottfried
Browse files

Add a Simple Build Script

It calls CMake to configure, build, and install KTouch and runs the
final application with the necessary environment setup.
parent 1774bbf7
......@@ -11,6 +11,19 @@ to type quickly and accurately.
# Development Setup
## Quick Start
In the top level directory there is a script called `build-install-run`
which can be used to configure, build, install and run KTouch in one
step. Execute:
./build-install-run
in the top-level directory of the KTouch repository to get started.
It is just simple wrapper arround CMake and set ups the necessary
environment variables to run KTouch. Build artifacts are stored in
the subdirectory `build/`, install files go to `install/`.
## Building
KTouch has the following build dependencies:
......
#!/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
CMAKE_ARGS="-DCMAKE_INSTALL_PREFIX=${INSTALLDIR} -DCMAKE_BUILD_TYPE=$BUILD_TYPE ../.."
# 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 ... "
export KDEDIRS=${INSTALLDIR}:$KDEDIRS
export XDG_DATA_DIRS=${INSTALLDIR}/share:$XDG_DATA_DIRS
# export QT_SCALE_FACTOR=2
${INSTALLDIR}/bin/ktouch
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