hdf5
hdf5 copied to clipboard
Error when trying to use CMake `FetchContent`
Describe the bug
using FetchContent_Declare
and FetchContent_MakeAvailable
works fine until i have to link the target, giving me an error
CMake Error at CMakeLists.txt:19 (target_link_libraries):
Target "cpptest" links to:
hdf5::hdf5
but the target was not found. Possible reasons include:
* There is a typo in the target name.
* A find_package call is missing for an IMPORTED target.
* An ALIAS target is missing.
Platform (please complete the following information)
- same errors happens on mac and ubuntu
- using cmake version 3.29.4
Additional context The full code is attached in the zip