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

[dunecontrol] Remove am2cmake

It converted to Autotools configure flags to CMake flags.
parent fd007d1d
No related branches found
No related tags found
No related merge requests found
......@@ -594,7 +594,6 @@ run_default_configure () {
# Translate the configure PARMS to cmake
export PARAMS
export CMAKE_PARAMS
module_translate_options_am2cmake $m $path/lib
if test x$module = x$m; then continue; fi # skip myself
name=$(eval "echo \$NAME_$m")
......
install(FILES dunemodules.lib dunecommonam2cmake.lib
install(FILES dunemodules.lib
DESTINATION ${CMAKE_INSTALL_BINDIR}/../lib)
# -*-sh-*-
##########################################
###
### Function for converting configure options
### to CMake options for dune-common
###
##########################################
space=" "
tab=" "
BLANK="$space$tab"
dune_common_options_am2cmake()
{
# CMake Packages are case sensitive
# This is a list of packages whose names converted
# to lower case are used for configures
# --with-<package> or without-<package> options
#
CMAKE_PACKAGES="Inkscape GMP LAPACK UMFPack"
default_am2cmake_options $CMAKE_PACKAGES
# Check for --disable-parallel and deactivate MPI if given
echo $PARAMS | grep \\-\\-disable-parallel > /dev/null
if test "$?" -eq 0 ; then
CMAKE_PARAMS="$CMAKE_PARAMS -DCMAKE_DISABLE_FIND_PACKAGE_MPI=TRUE"
else
CMAKE_PARAMS="$CMAKE_PARAMS -DCMAKE_DISABLE_FIND_PACKAGE_MPI=FALSE"
fi
# Check for --disable-cxx11check
echo $PARAMS | grep \\-\\-disable-cxx11check > /dev/null
if test "$?" -eq 0 ; then
CMAKE_PARAMS="$CMAKE_PARAMS -DDISABLE_CXX11CHECK:BOOL=TRUE"
fi
# Check for --with-minimal-debug-level
local arg=`echo "$PARAMS"| grep \\\\--with-minimal-debug-level= | sed "s/.*--with-minimal-debug-level=\([^$BLANK]*\).*/\1/"`
if test "x$arg" != "x"; then
CMAKE_PARAMS="$CMAKE_PARAMS -DMINIMAL_DEBUG_LEVEL:String=$arg"
fi
#Check for --prefix
local arg=`echo "$PARAMS"| grep \\\\--prefix= | sed "s/.*--prefix=\([^$BLANK]*\).*/\1/"`
if test "x$arg" != "x"; then
CMAKE_PARAMS="$CMAKE_PARAMS -DCMAKE_INSTALL_PREFIX=$arg"
fi
}
......@@ -613,83 +613,3 @@ check_version() {
fi
return 1
}
#
# Function that the translates options for configure
# The arguments are the case sensitive cmake package names.
# It is assumed that their lowercase version is used
# for the autotools. This function either deactivates
# a package using CMAKE_DISABLE_FIND_PACKAGE_<package>=TRUE
# or passes th provided path using
# the <CMAKE_PACKAGE_ALL_UPPERCASE>_ROOT variable
default_am2cmake_options(){
while test "$#" -gt 0; do
local package=$1
local lowercase=`tr 'A-Z' 'a-z' <<< $1`
local uppercase=`tr 'a-z' 'A-Z' <<< $1`
shift
if eval test \$"$lowercase"_processed ; then
continue
fi
export "$lowercase"_processed=1
# check for --without-$lowercase
echo $PARAMS | grep \\-\\-without-$lowercase > /dev/null
if test "$?" -eq 0 ; then
CMAKE_PARAMS="$CMAKE_PARAMS -DCMAKE_DISABLE_FIND_PACKAGE_$package=TRUE"
continue
fi
# process --with-$lowercase=<arg>
local arg=`echo $PARAMS| sed "s/.*--with-$lowercase=\([$NOBLANK]*\).*/\1/"`
local arg=`eval echo $arg` # expand tilde to prevent problems
if test "x$arg" = "xno"; then
CMAKE_PARAMS="$CMAKE_PARAMS -DCMAKE_DISABLE_FIND_PACKAGE_$package=TRUE"
continue
fi
if test -d "$arg"; then
CMAKE_PARAMS="$CMAKE_PARAMS -D$uppercase""_ROOT=$arg"
fi
done
export CMAKE_PARAMS
}
# Default translation routine for libraries.
# Arguments are the CMake package names.
# Searches for --with-<package>lib=<library>
# in the configure options and translates them
# to -D<PACKAGE>_LIBRARY=<library>
default_am2cmake_libraries(){
while test "$#" -gt 0; do
lib=$1
local lowercase=`tr 'A-Z' 'a-z' <<< $1`
local uppercase=`tr 'a-z' 'A-Z' <<< $1`
shift
if eval test \$"$lowercase"-lib_processed; then
continue
fi
export "$lowercase"-lib_processed=1
term="s/.*--with-""$lowercase""-lib=\([$NOBLANK]*\).*/\1/"
arg=`echo "$PARAMS" | grep \\-\\-with-$lowercase | sed "$term"`
if test "x$arg" != "x"; then
CMAKE_PARAMS="$CMAKE_PARAMS -D$uppercase""_LIBRARY=$arg"
fi
done
}
module_translate_options_am2cmake()
{
local module=$1 # the module name
local path=$2 # where the sh libs reside
# Check whether the module provides a lib named
# <module-without-dashes>autotools2cmake.lib
local module_undashed=`echo $module | sed "s/[-_]//g"`
local libfile="$path/$module_undashed""am2cmake.lib"
if test -e "$libfile"; then
. $libfile
local module_underline=`echo $module | sed "s/-/_/g"`
eval "$module_underline"_options_am2cmake
else
echo "$libfile for converting options does not exist"
fi
}
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