tbeu / matio

MATLAB MAT File I/O Library
https://matio.sourceforge.io
BSD 2-Clause "Simplified" License
330 stars 97 forks source link

Don't use existing CMake target names. #159

Closed MaartenBent closed 3 years ago

MaartenBent commented 3 years ago

When using CMake 3.19.0-rc2 I get the same error that #155 tries to solve:

CMake Error at cmake/thirdParties.cmake:34 (add_library):
add_library cannot create imported target "HDF5::HDF5" because another target with the same name already exists.

I propose a different solution. Use the MATIO namespace for imported libraries. Also check and use the HDF5::HDF5 and ZLIB::ZLIB targets if they exist.

coveralls commented 3 years ago

Coverage Status

Coverage remained the same at 82.304% when pulling 79113c56b9bb51dfae1061239e189002c57dde24 on MaartenBent:cmake-target-exists into 260a830c4f60e70df0b3ba22cdfbaad9431c0faf on tbeu:master.

tbeu commented 3 years ago

@madebr Does this also work for you?

madebr commented 3 years ago

I'm fine with that. I'll close my pr.