From 7a8867bb3c8779f0b10159d4a0e97b8dcecf19b7 Mon Sep 17 00:00:00 2001 From: Henrik Hautakoski Date: Mon, 20 Apr 2020 17:15:38 +0200 Subject: [PATCH] build.sh: Adding --no-cli,--gui flags --- build.sh | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/build.sh b/build.sh index 05ef766..06da719 100755 --- a/build.sh +++ b/build.sh @@ -1,11 +1,11 @@ #!/bin/bash function usage() { - echo "Usage: ${0##*/} [ -h|--help ] [ -t|--type Debug|Release|RelWithDebInfo|MinSizeRel ] [--pkg-type deb|zip|tgz] [ --disable-threads ] [ --force-ansi ]" + echo "Usage: ${0##*/} [ -h|--help ] [ --no-cli ] [ --gui] [ -t|--type Debug|Release|RelWithDebInfo|MinSizeRel ] [--pkg-type deb|zip|tgz] [ --disable-threads ] [ --force-ansi ]" exit 1 } -options=$(getopt -n "${0##*/}" -o "lht:" -l "help,type:,pkg-type:,disable-threads,force-ansi" -- "$@") +options=$(getopt -n "${0##*/}" -o "lht:" -l "help,no-cli,gui,type:,pkg-type:,disable-threads,force-ansi" -- "$@") [ $? -eq 0 ] || usage @@ -33,6 +33,10 @@ while true; do TARGET="package" ARGS="${ARGS} -DCPACK_GENERATOR=${1^^}" ;; + --no-cli) + ARGS="${ARGS} -DBUILD_COMPONENT_CLI=OFF" ;; + --gui) + ARGS="${ARGS} -DBUILD_COMPONENT_GUI=ON" ;; --disable-threads) ARGS="${ARGS} -DUSE_THREADS=OFF" ;; --force-ansi) @@ -48,6 +52,9 @@ while true; do shift done +# Remove cache first +rm build/CMakeCache.txt 2> /dev/null + cmake -B build $ARGS . if [ ${ONLY_CONFIG} -eq 0 ]; then cmake --build build --clean-first --target ${TARGET}