Commit 25be128c authored by Jakub Klinkovský's avatar Jakub Klinkovský
Browse files

Fixed the install script to work with RelWithDebInfo build type

parent b5b71869
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
/nbproject
/Debug
/Release
/RelWithDebInfo
/Testing
/Documentation/html/
/Documentation/output_snippets/
+4 −0
Original line number Diff line number Diff line
@@ -145,6 +145,10 @@ if [[ ! "Release Debug RelWithDebInfo" =~ "$BUILD" ]]; then
    echo "Unknown build type: $BUILD. The available build types are: Release, Debug, RelWithDebInfo." >&2
    exit 1
fi
if [[ ! -d "$BUILD" ]]; then
    mkdir "$BUILD"
fi
pushd "$BUILD" >/dev/null

# handle targets
for target in "$@"; do
+28 −46
Original line number Diff line number Diff line
@@ -2,27 +2,22 @@

set -e

BUILD_DEBUG="yes"
BUILD_RELEASE="yes"

BUILDS=(Debug Release)
OPTIONS=""

for option in "$@"; do
    case $option in
        --no-debug)
         BUILD_DEBUG="no"
            # remove Debug from builds
            BUILDS=("${BUILDS[@]/Debug}")
            ;;
        --no-release)
         BUILD_RELEASE="no"
            # remove Release from builds
            BUILDS=("${BUILDS[@]/Release}")
            ;;
        --build=*)
         BUILD="${option#*=}"
         if [[ "$BUILD" != "Release" ]]; then
            BUILD_RELEASE="no"
         fi
         if [[ "$BUILD" != "Debug" ]]; then
            BUILD_DEBUG="no"
         fi
            # replace builds with the supplied argument
            BUILDS=("${option#*=}")
            ;;
        *)
            OPTIONS="${OPTIONS} ${option}"
@@ -30,29 +25,16 @@ for option in "$@"; do
    esac
done

if [[ ${BUILD_DEBUG} == "yes" ]]; then
   if [[ ! -d Debug ]]; then
      mkdir Debug
   fi
   pushd Debug
   if ! ../build --build=Debug --install=yes ${OPTIONS}; then
      echo "Debug build failed."
      exit 1
   fi
   popd
fi

if [[ ${BUILD_RELEASE} == "yes" ]]; then
   if [[ ! -d Release ]]; then
      mkdir Release
for build in "${BUILDS[@]}"; do
    # skip empty strings that were left in the array after deleting prefixes
    if [[ -z "$build" ]]; then
        continue
    fi
   pushd Release
   if ! ../build --build=Release --install=yes ${OPTIONS}; then
      echo "Release build failed."
    if ! ./build --build="$build" --install=yes ${OPTIONS}; then
        echo "$build build failed."
        exit 1
    fi
   popd
fi
done


PREFIX=${HOME}/.local