ComputationalRadiationPhysics / libSplash

libSplash - Simple Parallel file output Library for Accumulating Simulation data using Hdf5
GNU Lesser General Public License v3.0
15 stars 15 forks source link

CMake: ZLIB Deps #283

Open ax3l opened 5 years ago

ax3l commented 5 years ago

We currently (1.7.0) link in CMakeLists.txt to ZLIB::ZLIB, although we do not include zlib directly in Splash.

This dependency should nowadays (recent CMake versions such as our 3.10+) be properly be pulled by the HDF5 CMake target.

Currently, we request zlib again and forget to search it in SplashConfig.cmake, which leads to the downstream issue of injecting a ZLIB::ZLIB in Splash::Splash yet not looking for a target. Therefore, users have to perform

find_package(ZLIB REQUIRED)
# just to get the ZLIB::ZLIB target into scope
# otherwise `Splash::Splash` below tries to link `-lZLIB::ZLIB`

find_package(Splash REQUIRED)
target_link_libraries(myTarget PRIVATE Splash::Splash)