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

[CMake][dunecontrol] Makes compiler and compiler flags visible to CMake.

CMake honors the familar compiler flags if they are exported. This patch
extracts them from CONFIGURE_FLAGS and exports them to cmake by putting
them in from of the cmake call.
parent 43a90d81
No related branches found
No related tags found
No related merge requests found
......@@ -569,12 +569,21 @@ run_default_configure () {
PARAMS="$PARAMS ACLOCAL_AMFLAGS=\"$ACLOCAL_FLAGS\""
if test "x$LOCAL_USE_CMAKE" = "xyes"; then
# we have to export the compiler and compiler flags
# such that they are honored by cmake.
flags="CXX CC CXXFLAGS CFLAGS CPPFLAGS LDFLAGS F77 FFLAGS FLIBS FC FCFLAGS FCLIBS LIBS"
for i in $flags; do
cflags=`echo $PARAMS | sed "s/.*\($i=\"[^\"]*\"\|$i=[^\s^ ]*\).*/\1/"`
if test "$cflags" != "$PARAMS"; then
PREPARAMS="$PREPARAMS $cflags"
fi
done
test -d "$BUILDDIR" || mkdir "$BUILDDIR"
SRCDIR="$PWD"
cd "$BUILDDIR"
echo `pwd`
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" || exit 1
echo "$PREPARAMS cmake -DBUILD_SHARED_LIBS:BOOL=OFF -DCMAKE_MODULE_PATH=\"$CMAKE_MODULE_PATH\" $CMAKE_PARAMS $CMAKE_FLAGS $SRCDIR"
eval $PREPARAMS cmake "-DBUILD_SHARED_LIBS:BOOL=OFF -DCMAKE_MODULE_PATH=\"$CMAKE_MODULE_PATH\" $CMAKE_PARAMS $CMAKE_FLAGS $SRCDIR" || exit 1
else
echo ./configure "$PARAMS"
# create build directory of requested
......
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