[Dune] using cmake to build your dune module
Sascha Zelzer
s.zelzer at dkfz-heidelberg.de
Wed Dec 8 13:43:04 CET 2010
Hi,
On 12/07/2010 04:14 PM, Christian Engwer wrote:
> Hi,
>
> I have no clue about CMake, but the points you raised are all possible
> using the current buildsystem.
>
>
Great, for me it is the opposite: I am not very familiar with
autoconf/automake...
>> 1.) Allow Dune modules to be located anywhere in the filesystem. Use
>> something like FIND_PACKAGE(Dune) inside the modules CMakeLists.txt
>> file to fetch all necessary build options from Dune. This would
>> external projects to integrate their Dune-Code into their
>> source-code layout.
>>
> you just have to specify the DUNE_CONTROL_PATH to allow searcing in
> other places. I further doubt that CMake can find your packages
> without further hints.
>
>
Of course some custom CMake scripts would be necessary, which would
handle similar tasks like dunecontrol does already.
I just discovered DUNE_CONTROL_PATH in the help text of "dunecontrol
--help". It woulde be nice to include a short section about how to
create an "external" Dune module in
http://www.dune-project.org/doc/buildsystem/buildsystem.pdf .
>> 2.) Allow out-of-source (aka shadow-builds) for Dune modules. I
>> think it would be nice to keep the source tree clean and allow for
>> separate Debug/Release builds, for example.
>>
> automake supports this aswell. The problem was that until recently it
> was not possible to use out-of-source builds via dunecontrol. I
> implemented this about a year ago.
>
I am using Dune-2.0. Does the buildsystem of this version support this?
I tried supplying --builddir to dunecontrol in combination with setting
DUNE_CONTROL_PATH, but I can't get it to work:
/tmp/dune_modules> export
DUNE_CONTROL_PATH=/opt/local-toolkits/dune-2.0:/tmp/dune_modules
/tmp/dune_modules>
/opt/local-toolkits/dune-2.0/dune-common-2.0/bin/duneproject
... creating module "dune-test"
/tmp/dune_modules>
/opt/local-toolkits/dune-2.0/dune-common-2.0/bin/dunecontrol
--opts=./dune.opts --only=dune-test --builddir=bin-dir all
This result is the same as without the "--builddir" argument. Any help
on this would be highly appreciated!
> I think the main advantage of CMake would be, that you can use DUNE
> with IDEs like MS VisualStudio. If this is worth the effort, must be
> decided by those, implementing the changes.
>
>
Don't get me wrong, I think the current buildsystem is well thought-out
and works fine. I really like the duneproject script :-)
I also like CMake because it is cross-platform, has inherent support for
out-of-source builds and can generate native "project" files, which has
the advantage to be able to work with any Editor/IDE/whatever out of the
box (as you mentioned).
Thanks a lot for your effort and comments,
Sascha
More information about the Dune
mailing list