Summary
When iceberg-cpp is built against a system Avro (avro-cpp found through FIND_PACKAGE_ARGS), the installed
iceberg-config.cmake can't be consumed: find_package(iceberg CONFIG) fails at find_dependency(Avro).
Cause
In resolve_avro_dependency() (cmake_modules/IcebergThirdpartyToolchain.cmake), the non-vendored branch does:
else()
set(AVRO_VENDORED FALSE)
list(APPEND ICEBERG_SYSTEM_DEPENDENCIES Avro)
endif()
However, the package that was actually found is avro-cpp. It is declared with fetchcontent_declare(avro-cpp ... FIND_PACKAGE_ARGS ...), and its config exports the avro-cpp::avrocpp_* targets. Avro 1.12 installs
avro-cpp-config.cmake and no Avro package. So iceberg_find_dependencies() in the installed config calls
find_dependency(Avro), which can't be satisfied.
Reproduction
Seen with v0.4.0 (the code is unchanged on main) using vcpkg's avro-cpp 1.12.2 on x64-windows:
- Build and install iceberg-cpp with the bundle enabled against the system
avro-cpp.
- In a consumer project, call
find_package(iceberg CONFIG REQUIRED).
- Configuring fails because the
Avro package can't be found.
Suggested fix
Record the real package name:
list(APPEND ICEBERG_SYSTEM_DEPENDENCIES avro-cpp)
The same one-line change is carried as a patch in the proposed vcpkg port; I'm happy to open a PR here as well.
Summary
When iceberg-cpp is built against a system Avro (
avro-cppfound throughFIND_PACKAGE_ARGS), the installediceberg-config.cmakecan't be consumed:find_package(iceberg CONFIG)fails atfind_dependency(Avro).Cause
In
resolve_avro_dependency()(cmake_modules/IcebergThirdpartyToolchain.cmake), the non-vendored branch does:However, the package that was actually found is
avro-cpp. It is declared withfetchcontent_declare(avro-cpp ... FIND_PACKAGE_ARGS ...), and its config exports theavro-cpp::avrocpp_*targets. Avro 1.12 installsavro-cpp-config.cmakeand noAvropackage. Soiceberg_find_dependencies()in the installed config callsfind_dependency(Avro), which can't be satisfied.Reproduction
Seen with v0.4.0 (the code is unchanged on
main) using vcpkg'savro-cpp1.12.2 on x64-windows:avro-cpp.find_package(iceberg CONFIG REQUIRED).Avropackage can't be found.Suggested fix
Record the real package name:
The same one-line change is carried as a patch in the proposed vcpkg port; I'm happy to open a PR here as well.