Don't treat hdf5 libraries as if they were directories
This causes nonsensical arguments to be added to the build, e.g.
-L/opt/local/lib/libhdf5.dylib
-L/opt/local/lib/libsz.dylib
-L/opt/local/lib/libz.dylib
-Wl,-rpath,/opt/local/lib/libhdf5.dylib
-Wl,-rpath,/opt/local/lib/libsz.dylib
-Wl,-rpath,/opt/local/lib/libz.dylib
which causes warnings to be printed:
ld: warning: path '/opt/local/lib/libhdf5.dylib' following -L not a directory
ld: warning: path '/opt/local/lib/libsz.dylib' following -L not a directory
ld: warning: path '/opt/local/lib/libz.dylib' following -L not a directory
This was reported to MacPorts by @barracuda156 here: https://trac.macports.org/ticket/70467
The correct thing to do is to tell the build to use the hdf5 libraries as libraries. That's already happening later in the file:
https://github.com/thliebig/openEMS/blob/1ccf0942477e9178b27f5e00dddd4d62bff78d29/CMakeLists.txt#L206-L215
So the wrong link_directories line just needs to be removed.
The bug was introduced in 23518278e8687cabd83b543afa22b58eaf049d6d.
Hi. I'm pretty sure that I did not make this change you mentioned just for fun but because it caused problems before. Did you verify that this change does still work as intended on Windows and Linux? Otherwise I would recommend to make this change only for mac?
@thliebig From my side I can only check on macOS (which has been done and was the reason for the ticket). I do not have a working Linux setup for testing.
Maybe you could add CI to the repo?