Skip to content
Snippets Groups Projects
Commit c78765c1 authored by Markus Blatt's avatar Markus Blatt
Browse files

[dunecontrol] Stop overwriting BUIDDIR from options file.

Previously a value specified on the command line was always
overwritten by a value set in an options file. This patch
fixes this together with overwriting the build directory with
the default build-cmake when --use-cmake was specified.
parent 609aced0
No related branches found
No related tags found
No related merge requests found
......@@ -165,10 +165,13 @@ load_opts() {
local CMD_FLAGS_FROM_FILE=""
BUILDDIR=$DUNE_BUILDDIR
if test "x$DUNE_OPTS_FILE" != "x"; then
# use build dir from opts file if set
OPTS_FILE_BUILDDIR="$(eval BUILDDIR=""; . $DUNE_OPTS_FILE; eval echo \$BUILDDIR)"
if test -n "$OPTS_FILE_BUILDDIR"; then
BUILDDIR="$OPTS_FILE_BUILDDIR"
if test -z "$BUILDDIR"; then
# no builddir set yet, use build dir from opts file if set
# Note: if --use-buiddir is used BUILDDIR will be set already
OPTS_FILE_BUILDDIR="$(eval BUILDDIR=""; . $DUNE_OPTS_FILE; eval echo \$BUILDDIR)"
if test -n "$OPTS_FILE_BUILDDIR"; then
BUILDDIR="$OPTS_FILE_BUILDDIR"
fi
fi
CMAKE_FLAGS="$(. $DUNE_OPTS_FILE; eval echo \$CMAKE_FLAGS)"
CMD_FLAGS_FROM_FILE="$(eval ${COMMAND}_FLAGS=""; . $DUNE_OPTS_FILE; eval echo \$${COMMAND}_FLAGS)"
......@@ -882,12 +885,12 @@ done
if test "x$USE_CMAKE" = "xyes"; then
# load general options. DUNE_BUILDDIR might be overwritten in the opts file
load_opts NONE
if test -z "$DUNE_BUILDDIR"; then
if test -z "$BUILDDIR"; then
echo "No build directory provided. Defaulting to the sub directory build-cmake"
export DUNE_BUILDDIR=build-cmake
export BUILDDIR=build-cmake
fi
fi
echo "USE_CMAKE=$USE_CMAKE DUNE_BUILDDIR=$DUNE_BUILDDIR"
# we assume there should be a command...
if test "x$command" = "x"; then
usage
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment