rohanjain101 opened a new issue, #973:
URL: https://github.com/apache/iceberg-cpp/issues/973

   ## 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:
   
   ```cmake
     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:
   
   ```cmake
       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.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to