[Dune-devel] .in-file mechanism with cmake?!

Christian Engwer christian.engwer at uni-muenster.de
Wed Jul 15 16:22:23 CEST 2015


On Wed, Jul 15, 2015 at 04:05:44PM +0200, Christoph Grüninger wrote:
> Hi Christian,
> configure_file is a very general concept. It replaces every ${variable}
> or @variable@ by the value of the according variable from the current
> scope of your CMake script.
> 
> [domain.test2d]
> dim = 2
> mesh = ${CMAKE_SOURCE_DIR}/src/grids/rectangle.msh

this is no option, as the module is supposed to work with both
autotools and cmake.

Remember... we are in the transition period ;-)

But I found the solution... not nice, but it works. I add a set of
definitions before the actual configure_file statement:

set(top_srcdir ${CMAKE_SOURCE_DIR})
set(abs_top_srcdir ${CMAKE_SOURCE_DIR})
set(srcdir ${CMAKE_CURRENT_SOURCE_DIR})
set(top_builddir ${CMAKE_BINARY_DIR})
set(abs_top_builddir ${CMAKE_BINARY_DIR})
set(builddir ${CMAKE_CURRENT_BINARY_DIR})

should be add a function which sets these convinience definitions?
Perhaps one could add a command like

autotools_configure_file(...)

which sets all required variables (i'm sure I forgot a couple of them,
but these are the most common ones, perhaps some more regarding
gridtype or similar) and then we can later deprecate this mthod to
force people to update the code.

Christian

> refine = 1
> 
> should do the trick.
> 
> Bye
> Christoph
> 
> -- 
> A mathematician is a scientist who can figure out anything, except
> such simple things as squaring the circle and trisecting an angle.
> [Evan Esar (1899-1995), Esar's Comic Dictionary]
> 



> _______________________________________________
> Dune-devel mailing list
> Dune-devel at dune-project.org
> http://lists.dune-project.org/mailman/listinfo/dune-devel


-- 
Prof. Dr. Christian Engwer 
Institut für Numerische und Angewandte Mathematik
Fachbereich Mathematik und Informatik der Universität Münster
Einsteinstrasse 62
48149 Münster

E-Mail	christian.engwer at uni-muenster.de
Telefon	+49 251 83-35067
FAX		+49 251 83-32729




More information about the Dune-devel mailing list