Skip to content

Commit f062670

Browse files
author
Stefan Buschmann
authored
Merge pull request #81 from Jopyth/add_parent_build_directory
Add possibility to build in nested folders
2 parents 7400573 + df1cc14 commit f062670

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

configure

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -104,14 +104,15 @@ echo "Configuring ..."
104104
echo ""
105105

106106
# Create build directory
107-
if [ ! -d "./$BUILD_DIR" ]
107+
if [ ! -d "$BUILD_DIR" ]
108108
then
109-
mkdir $BUILD_DIR
109+
mkdir -p "$BUILD_DIR"
110110
fi
111111

112112
# Configure project
113+
PREVIOUS_DIR=$(pwd)
113114
cd $BUILD_DIR
114-
cmake -G "$CMAKE_GENERATOR" "-DCMAKE_BUILD_TYPE=$BUILD_TYPE" $CMAKE_OPTIONS ..
115+
cmake -G "$CMAKE_GENERATOR" "-DCMAKE_BUILD_TYPE=$BUILD_TYPE" $CMAKE_OPTIONS "$PREVIOUS_DIR"
115116
if [ $? == 0 ]
116117
then
117118
echo ""
@@ -123,4 +124,4 @@ else
123124
echo "Configuration failed.";
124125
fi
125126

126-
cd ..
127+
cd "$PREVIOUS_DIR"

0 commit comments

Comments
 (0)