Skip to content
Snippets Groups Projects
Commit 72e14387 authored by Christoph Grüninger's avatar Christoph Grüninger
Browse files

[buildsystem] By default CMake is used instead of autotools.

Pass --no-cmake to dunecontrol to force the use of autotools.
If no build directory is given, make files, libararies and
executables are in <module-dir>/build-cmake/ .
Further information in FS#1000 and FS#1500.
parents 94fb9167 2c0f7856
No related branches found
No related tags found
No related merge requests found
......@@ -6,11 +6,27 @@ set -e
###
### check for environment variables
###
if test -z "$GREP"; then
GREP=grep
fi
if test -z "$SED"; then
SED=sed
fi
if test -z "$MAKE"; then
MAKE=make
fi
system_default_cmake="no"
if test -z "$CMAKE"; then
CMAKE=cmake
system_default_cmake="yes"
fi
space=" "
tab=" "
BLANK="$space$tab"
###############################################
###
### read lib
......@@ -172,8 +188,12 @@ load_opts() {
if test -n "$OPTS_FILE_USE_CMAKE"; then
USE_CMAKE="$OPTS_FILE_USE_CMAKE"
fi
# if still no USE_CMAKE is set, default to true
if test -z "$USE_CMAKE"; then
USE_CMAKE="yes"
fi
fi
if test -n "$USE_CMAKE" && test -z "$CMAKE"; then
if test -n "$USE_CMAKE" && test "$system_default_cmake" = "yes"; then
# We use cmake for building, but CMAKE is not yet set.
# Check the opts file for it
OPTS_FILE_CMAKE="$(eval CMAKE=""; . $DUNE_OPTS_FILE; eval echo \$CMAKE)"
......@@ -183,10 +203,6 @@ load_opts() {
fi
fi
fi
if test -n "$USE_CMAKE" && test -z "$CMAKE"; then
# fall back to system cmake
CMAKE=cmake
fi
if test "x$DUNE_OPTS_FILE" != "x"; then
if test "$command" = "configure"; then
CMAKE_FLAGS="$(. $DUNE_OPTS_FILE; eval echo \$CMAKE_FLAGS)"
......@@ -200,9 +216,8 @@ load_opts() {
echo "----- using default flags \$${COMMAND}_FLAGS from environment -----"
fi
if test "x$USE_CMAKE" = "xyes"; then
if test "x$USE_CMAKE" != "xno"; then
if test -z "$BUILDDIR"; then
echo "No build directory provided. Defaulting to the sub directory build-cmake"
export BUILDDIR=build-cmake
fi
fi
......@@ -224,16 +239,6 @@ abs_builddir()
esac
}
space=" "
tab=" "
BLANK="$space$tab"
if test -z "$GREP"; then
GREP=grep
fi
if test -z "$SED"; then
SED=sed
fi
# Uses the current compiler to extract information about the
# multiarch triplets and sets the export variable MULTIARCH_LIBDIR
# according to it.
......@@ -581,7 +586,7 @@ run_default_update () {
}
run_default_autogen () {
if test "x$USE_CMAKE" != "xyes" || test ! -e "$(eval "echo \$PATH_$module")/CMakeLists.txt" ; then
if test "x$USE_CMAKE" = "xno" || test ! -e "$(eval "echo \$PATH_$module")/CMakeLists.txt" ; then
PARAMS="$CMD_FLAGS"
local M4_PATH=""
if test -f configure.ac && \
......@@ -608,7 +613,7 @@ run_default_autogen () {
run_default_configure () {
extract_multiarch
PARAMS="$CMD_FLAGS"
if test "x$USE_CMAKE" = "xyes" && test -e "$(eval "echo \$PATH_$module")/CMakeLists.txt"; then
if test "x$USE_CMAKE" != "xno" && test -e "$(eval "echo \$PATH_$module")/CMakeLists.txt"; then
LOCAL_USE_CMAKE=yes
else
LOCAL_USE_CMAKE=no
......@@ -716,6 +721,7 @@ run_default_configure () {
run_default_make () {
test ! -d "$ABS_BUILDDIR" || cd "$ABS_BUILDDIR"
PARAMS="$CMD_FLAGS"
echo "build directory: $BUILDDIR"
echo make "$PARAMS"
eval $MAKE "$PARAMS"
}
......
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