hdf5 icon indicating copy to clipboard operation
hdf5 copied to clipboard

Error when trying to use CMake `FetchContent`

Open fnrizzi opened this issue 7 months ago • 8 comments

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

Archive.zip

fnrizzi avatar Jul 04 '24 12:07 fnrizzi