Skip to content

Commit 14c6922

Browse files
committed
Review configure setup
1 parent fd5ef29 commit 14c6922

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
*.a
1414

1515
# Build dir
16+
*-build*
1617
build*
1718
debug_build
1819
release_build

configure

+10-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#!/bin/bash
22

33
# Default options
4+
45
BUILD_DIR="build"
56
CMAKE_GENERATOR="Unix Makefiles"
67
BUILD_TYPE="Release"
@@ -105,8 +106,12 @@ then
105106
CMAKE_GENERATOR="$CMAKE_GENERATOR_OVERRIDE"
106107
fi
107108

109+
if [ -n "$BUILD_DIR_PREFIX" ]; then
110+
BUILD_DIR="${BUILD_DIR_PREFIX}-${BUILD_DIR}"
111+
fi
112+
108113
# Configure build
109-
echo "Configuring in $BUILD_DIR..."
114+
echo "Configuring in \"$BUILD_DIR\""
110115
echo ""
111116

112117
# Create build directory
@@ -116,8 +121,10 @@ then
116121
fi
117122

118123
# Configure project
124+
119125
PREVIOUS_DIR=$(pwd)
120-
cd $BUILD_DIR
126+
127+
pushd $BUILD_DIR
121128
echo cmake -G "$CMAKE_GENERATOR" "-DCMAKE_BUILD_TYPE=$BUILD_TYPE" $CMAKE_OPTIONS "$PREVIOUS_DIR"
122129
cmake -G "$CMAKE_GENERATOR" "-DCMAKE_BUILD_TYPE=$BUILD_TYPE" $CMAKE_OPTIONS "$PREVIOUS_DIR"
123130
if [ $? == 0 ]
@@ -130,5 +137,4 @@ else
130137
echo ""
131138
echo "Configuration failed.";
132139
fi
133-
134-
cd "$PREVIOUS_DIR"
140+
popd

0 commit comments

Comments
 (0)