From 4c57e48a3d688eb05d128f69527523f7d5c09474 Mon Sep 17 00:00:00 2001 From: Andrey Astafyev Date: Thu, 14 Mar 2019 11:14:57 +0300 Subject: [PATCH] =?UTF-8?q?=D0=95=D1=81=D0=BB=D0=B8=20=D0=BD=D0=B0=D0=B9?= =?UTF-8?q?=D0=B4=D0=B5=D0=BD=20Ninja,=20=D0=B8=D1=81=D0=BF=D0=BE=D0=BB?= =?UTF-8?q?=D1=8C=D0=B7=D0=BE=D0=B2=D0=B0=D1=82=D1=8C=20=D0=BF=D0=BE=20?= =?UTF-8?q?=D1=83=D0=BC=D0=BE=D0=BB=D1=87=D0=B0=D0=BD=D0=B8=D1=8E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- cmake.sh | 8 +++++++- qtcreator-debug.sh | 8 +------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/cmake.sh b/cmake.sh index 452584b..89d89b1 100755 --- a/cmake.sh +++ b/cmake.sh @@ -21,7 +21,8 @@ LONGOPTS=generator:,type:,qtcreator,cmake,force,source-dir:,build-dir:,output-di eval set -- "$PARSED" # Default generator -GENERATOR="Unix Makefiles" +[ -x "$(command -v make)" ] && GENERATOR="Unix Makefiles" +[ -x "$(command -v ninja)" ] && GENERATOR=Ninja # Generate single build type SINGLE_TYPE="n" @@ -89,6 +90,11 @@ while true; do esac done +if [ "x${GENERATOR}" = "x" ]; then + echo "Build command is not found" + exit 1 +fi + CMAKE_ARGS="" [ ${#@} -gt 0 ] && CMAKE_ARGS=("${@}") diff --git a/qtcreator-debug.sh b/qtcreator-debug.sh index 4bb2cfb..9343bb8 100755 --- a/qtcreator-debug.sh +++ b/qtcreator-debug.sh @@ -1,12 +1,6 @@ #!/bin/bash -[ -x "$(command -v make)" ] && GENERATOR="Unix Makefiles" -[ -x "$(command -v ninja)" ] && GENERATOR=Ninja -if [ "x${GENERATOR}" = "x" ]; then - echo "Build command is not found" - exit 1 -fi PROJECT=$(grep -i "^Project" "$(dirname -- "$(dirname -- "$(pwd)")")/CMakeLists.txt" | awk -F'[()]' '{print $2}') -"$(dirname $0)/cmake.sh" -g "${GENERATOR}" -f -t Debug +"$(dirname $0)/cmake.sh" -f -t Debug