Compare commits

...

4 Commits

2 changed files with 16 additions and 7 deletions

View File

@@ -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,7 +90,12 @@ while true; do
esac
done
CMAKE_ARGS=()
if [ "x${GENERATOR}" = "x" ]; then
echo "Build command is not found"
exit 1
fi
CMAKE_ARGS=""
[ ${#@} -gt 0 ] && CMAKE_ARGS=("${@}")
[ ! -f "${SOURCE_DIR}/CMakeLists.txt" ] && { echo "Source directory does not contain CMakeLists.txt"; exit 4; }
@@ -181,8 +187,13 @@ export -f generate_configuration
if [ "x$SINGLE_TYPE" != "xn" ]; then
BUILD_TYPES=("${SINGLE_TYPE}")
else
[ "x$QTCREATOR" == "xy" ] && BUILD_TYPES=("${QTCREATOR_BUILD_TYPES[@]}")
[ "x$CMAKE" == "xy" ] && BUILD_TYPES=("${CMAKE_BUILD_TYPES[@]}")
if [ "x$QTCREATOR" == "xy" ]; then
BUILD_TYPES=("${QTCREATOR_BUILD_TYPES[@]}")
elif [ "x$CMAKE" == "xy" ]; then
BUILD_TYPES=("${CMAKE_BUILD_TYPES[@]}")
else
BUILD_TYPES=("Release")
fi
fi
if [ ${#BUILD_TYPES[@]} -eq 0 ]; then

View File

@@ -1,8 +1,6 @@
#!/bin/bash
GENERATOR=make
[ -x "$(command -v ninja)" ] && GENERATOR=Ninja
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