[Dune-devel] [Dune-Commit] [Commit] dune-grid - 7e27d3c: [UseUG.cmake] Parse Dune patchlevel, set macro HAVE_UG_PATCH10.

Andreas Buhr andreas at andreasbuhr.de
Wed May 15 13:20:05 CEST 2013


Hi Christoph,

Deine Änderungen an UseUG.cmake verhindern, dass dune-grid auf Systemen 
gebaut werden kann, auf denen kein UG installiert ist.

Was passiert ist das folgende:

Er findet kein UG
${UG_VERSION} ist leer

Dann steigt CMake aus in UseUG, Zeile 22 mit der Fehlermeldung:
"string sub-command REGEX, mode MATCH needs at least 5 arguments total 
to command."

Diese Zeile ist das Problem:

string(REGEX MATCH "[0-9]*$" UG_DUNE_PATCHLEVEL ${UG_VERSION})

Und später kommt dann noch als Fehler:

<Fehler>
CMake Error at cmake/modules/UseUG.cmake:29 (if):
   if given arguments:

     "GREATER" "9"

   Unknown arguments specified
</Fehler>

Könntest Du da bitte mal nach schauen?

danke und viele Grüße
Andreas


On 05/12/2013 04:11 PM, Christoph Grüninger wrote:
> New commit, appeared at Sun May 12 16:11:05 2013 +0200
> as part of the following ref changes:
>
>      branch refs/heads/master    updated from bb637bc -> 7e27d3c
>
> Browsable version: http://cgit.dune-project.org/repositories/dune-grid/commit/?id=7e27d3c2bb2935a58f46fdb630a28e5a347918ef
>
> ======================================================================
>
> commit 7e27d3c2bb2935a58f46fdb630a28e5a347918ef
> Author: Christoph Grüninger <gruenich at dune-project.org>
> Date:   Sun May 12 16:10:01 2013 +0200
>
>      [UseUG.cmake] Parse Dune patchlevel, set macro HAVE_UG_PATCH10.
>
>   cmake/modules/UseUG.cmake | 10 +++++++++-
>   config.h.cmake            |  3 +++
>   2 files changed, 12 insertions(+), 1 deletion(-)
>
>
>
> diff --git a/cmake/modules/UseUG.cmake b/cmake/modules/UseUG.cmake
> index b1f45fd..1d9e907 100644
> --- a/cmake/modules/UseUG.cmake
> +++ b/cmake/modules/UseUG.cmake
> @@ -16,14 +16,22 @@ if(NOT CMAKE_DISABLE_FIND_PACKAGE_UG)
>     if(NOT UG_FOUND)
>       message(WARNING "CMake will only find UG 3.9.1-patch10 or newer. Maybe you need to upgrade?")
>     endif(NOT UG_FOUND)
> -  message(AUTHOR_WARNING "We need to test for the patch level, too!")
>   endif(NOT CMAKE_DISABLE_FIND_PACKAGE_UG)
>   set(HAVE_UG ${UG_FOUND})
> +# parse patch level: last number in UG version string is DUNE patch level
> +string(REGEX MATCH "[0-9]*$" UG_DUNE_PATCHLEVEL ${UG_VERSION})
>
>   dune_define_gridtype(GRID_CONFIG_H_BOTTOM GRIDTYPE UGGRID ASSERTION GRIDDIM == WORLDDIM
>       DUNETYPE "Dune::UGGrid< dimgrid >"
>       HEADERS dune/grid/uggrid.hh dune/grid/io/file/dgfparser/dgfug.hh)
>
> +# Remove the following as soon as we absolutely require patch10 or higher
> +if(${UG_DUNE_PATCHLEVEL} GREATER 9)
> +  set(HAVE_UG_PATCH10 1)
> +else()
> +  set(HAVE_UG_PATCH10 0)
> +endif(${UG_DUNE_PATCHLEVEL} GREATER 9)
> +
>   #Overwrite flags by hand (like for autoconf).
>   set(UG_LIBRARIES dunegrid)
>   set(paths "${prefix}")
> diff --git a/config.h.cmake b/config.h.cmake
> index a9921c7..3274785 100644
> --- a/config.h.cmake
> +++ b/config.h.cmake
> @@ -64,6 +64,9 @@
>      uses the UG_CPPFLAGS */
>   #cmakedefine HAVE_UG ENABLE_UG
>
> +/* Do we have UG in at least version 3.9.1-patch10? */
> +#define HAVE_UG_PATCH10 ${HAVE_UG_PATCH10}
> +
>   /* Grid type magic for DGF parser */
>   @GRID_CONFIG_H_BOTTOM@
>   /* end dune-grid */
>
> _______________________________________________
> Dune-Commit mailing list
> Dune-Commit at dune-project.org
> http://lists.dune-project.org/mailman/listinfo/dune-commit
>





More information about the Dune-devel mailing list