Skip to content

Installed iceberg-config.cmake calls find_dependency(Avro) instead of avro-cpp #973

Description

@rohanjain101

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:

  1. Build and install iceberg-cpp with the bundle enabled against the system avro-cpp.
  2. In a consumer project, call find_package(iceberg CONFIG REQUIRED).
  3. 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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions