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

First halfway functional version of dunecontrol with support for

translating options for provided for configure to CMake syntax.

[[Imported from SVN: r7448]]
parent dcc9edf4
No related branches found
No related tags found
No related merge requests found
......@@ -415,6 +415,11 @@ run_default_configure () {
CMAKE_PARAMS="$CMAKE_PARAMS \"-D""$name""_DIR=$path\""
fi
fi
#
# Translate the configure PARMS to cmake
export PARAMS
export CMAKE_PARAMS
module_translate_options_am2cmake $m $path/lib
fi
done
......@@ -428,6 +433,10 @@ run_default_configure () {
SRCDIR="$PWD"
cd "$BUILDDIR"
echo `pwd`
# Translate the configure PARMS to cmake
export PARAMS
export CMAKE_PARAMS
module_translate_options_am2cmake $m $path/lib
echo "cmake -DBUILD_SHARED_LIBS:BOOL=OFF -DCMAKE_MODULE_PATH=\"$CMAKE_MODULE_PATH\" $CMAKE_PARAMS $CMAKE_FLAGS $SRCDIR"
eval cmake "-DBUILD_SHARED_LIBS:BOOL=OFF -DCMAKE_MODULE_PATH=\"$CMAKE_MODULE_PATH\" $CMAKE_PARAMS $CMAKE_FLAGS $SRCDIR"
else
......
install(FILES dunemodules.lib DESTINATION ${CMAKE_INSTALL_BINDIR}/../lib)
install(FILES dunemodules.lib dunecommonam2cmake.lib
DESTINATION ${CMAKE_INSTALL_BINDIR}/../lib)
# $Id: $
dunemodulelibdir=$(libdir)
EXTRA_DIST = CMakeLists.txt dunemodules.lib
dunemodulelib_DATA = dunemodules.lib
EXTRA_DIST = CMakeLists.txt dunemodules.lib dunecommonam2cmake.lib
dunemodulelib_DATA = dunemodules.lib dunecommonam2cmake.lib
#the dune-common library
lib_LTLIBRARIES = libdunecommon.la
......
# -*-sh-*-
##########################################
###
### Function for converting configure options
### to CMake options for dune-common
###
##########################################
# 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="Boost Inkscape GMP LAPACK"
dune_common_options_am2cmake()
{
default_am2cmake_options $CMAKE_PACKAGES
}
......@@ -574,3 +574,58 @@ 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
package=$1
lowercase=${1,,}
uppercase=${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>
arg=`echo $PARAMS| sed "s/.*--with-$lowercase=\(\S*\).*/\1/"`
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
}
module_translate_options_am2cmake()
{
module=$1 # the module name
path=$2 # where the sh libs reside
# Check whether the module provides a lib named
# <module-without-dashes>autotools2cmake.lib
module_undashed=`echo $module | sed "s/[-_]//g"`
libfile="$path/$module_undashed""am2cmake.lib"
if test -e "$libfile"; then
. $libfile
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