Skip to content

Commit

Permalink
Review configure setup
Browse files Browse the repository at this point in the history
  • Loading branch information
scheibel committed Nov 2, 2023
1 parent 6ae6961 commit 9d32c2e
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 4 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
*-build*
build*
*_build
/install
Expand Down
21 changes: 17 additions & 4 deletions configure
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/bin/bash

# Default options

BUILD_DIR="build"
CMAKE_GENERATOR="Unix Makefiles"
BUILD_TYPE="Release"
Expand Down Expand Up @@ -99,8 +100,18 @@ do
fi
done

if [ "$CMAKE_GENERATOR_OVERRIDE" != "" ]
then
echo "Override CMAKE_GENERATOR to $CMAKE_GENERATOR_OVERRIDE"
CMAKE_GENERATOR="$CMAKE_GENERATOR_OVERRIDE"
fi

if [ -n "$BUILD_DIR_PREFIX" ]; then
BUILD_DIR="${BUILD_DIR_PREFIX}-${BUILD_DIR}"
fi

# Configure build
echo "Configuring ..."
echo "Configuring in \"$BUILD_DIR\""
echo ""

# Create build directory
Expand All @@ -110,8 +121,11 @@ then
fi

# Configure project

PREVIOUS_DIR=$(pwd)
cd $BUILD_DIR

pushd $BUILD_DIR
echo cmake -G "$CMAKE_GENERATOR" "-DCMAKE_BUILD_TYPE=$BUILD_TYPE" $CMAKE_OPTIONS "$PREVIOUS_DIR"
cmake -G "$CMAKE_GENERATOR" "-DCMAKE_BUILD_TYPE=$BUILD_TYPE" $CMAKE_OPTIONS "$PREVIOUS_DIR"
if [ $? == 0 ]
then
Expand All @@ -123,5 +137,4 @@ else
echo ""
echo "Configuration failed.";
fi

cd "$PREVIOUS_DIR"
popd

0 comments on commit 9d32c2e

Please sign in to comment.