[Dune-devel] ALUGrid with CMake brings in zlib dependency

Christoph GrĂ¼ninger christoph.grueninger at iws.uni-stuttgart.de
Tue Nov 25 08:15:02 CET 2014


Hi,
when I have dune-alugrid with CMake, I get linker errors because zlib is
missing. This happens for a target, where I don't use ALUGrid at all.
The quick workaround is to add the zlib library manually to my target
groundwater with
target_link_libraries(groundwater ${ZLIB_LIBRARIES})

What is the right way to fix this?
(a) Do not include libdunealugrid to the variable ${DUNE_LIBS}? Then we
had to add the library in the add_dune_alugrid_flags function where we
could conditionally add the zlib, too.
(b) Add zlib, if found, to ${DUNE_LIBS} when we add libdunealugrid.

I would prefer (a) as it reduces the linker time when we do not use
ALUGrid. But it contradict the idea of ${DUNE_LIBS} which should contain
all Dune library already built.

What do you think?

Bye,
Christoph

-- 
GDB does hate your application, expresses its contempt through the
design of its command-line interface.   -- Tom Tromey, FOSDEM 2014

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: OpenPGP digital signature
URL: <https://lists.dune-project.org/pipermail/dune-devel/attachments/20141125/cd5b2881/attachment.sig>


More information about the Dune-devel mailing list