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

Dominic Kempf dominic.r.kempf at gmail.com
Wed Jul 15 16:04:46 CEST 2015


Hey Christian,

did you try writing CMAKE_SOURCE_DIR instead of top_srcdir?

Dominic

On Wed, Jul 15, 2015 at 4:00 PM, Christian Engwer <
christian.engwer at uni-muenster.de> wrote:

> Dear cmake gurus,
>
> I want to update an existing project to work with cmake and stumbled
> again over an issue, which I was not able to solve by myself.
>
> I currently have a file foo.ini.in with a content similar to:
>
> [domain.test2d]
> dim = 2
> mesh = @top_srcdir@/src/grids/rectangle.msh
> refine = 1
>
> which allows me specify a mesh location in the source tree easily via
> the generated ini file, even if I use out-of-source builds.
>
> For autotools I added the foo.ini.in to the list of generated files
> in configure.ac:
>
> AC_CONFIG_FILES([
> ...
>    src/foo.ini
> ])
>
> Now I tried to do the same for cmake. I added to following to
> src/CMakeLists.txt:
>
> configure_file(foo.ini.in foo.ini)
>
> but configure_file doesn't know about @top_srcdir@ and similar. I fist
> would have thought tis should work, as it works for Doxyfile.in, but
> it doesn't. Then I check the DuneDoxygen.cmake and it seems that this
> does some fancy tricks with by directly calling cmake. Is this the
> official way to go? Or is there an easier way, which forks for
> "simple" .in-files? If it's not the case we should consider
> encapsulating the doxygen magic, as .in files could be something more
> people use. At least it was a nice trick I have shown a couple of
> people.
>
> Christian
>
>
> _______________________________________________
> Dune-devel mailing list
> Dune-devel at dune-project.org
> http://lists.dune-project.org/mailman/listinfo/dune-devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.dune-project.org/pipermail/dune-devel/attachments/20150715/f28bc569/attachment.htm>


More information about the Dune-devel mailing list