Skip to content

810 improve cmakelists#889

Closed
shivendra-dev54 wants to merge 2 commits intoapache:mainfrom
shivendra-dev54:810-improve-cmakelists
Closed

810 improve cmakelists#889
shivendra-dev54 wants to merge 2 commits intoapache:mainfrom
shivendra-dev54:810-improve-cmakelists

Conversation

@shivendra-dev54
Copy link
Contributor

Reason for this PR

This PR addresses #810 to improve the portability and installation of the GraphAr C++ library. The current setup makes it difficult for downstream projects to use find_package(graphar), which this update resolves by modernizing the CMake export logic.

What changes are included in this PR?

  • Modern CMake Targets: Added support for the graphar::graphar namespace via install(EXPORT).
  • Hybrid Linking Strategy: Updated dependencies (Arrow/Parquet) to PUBLIC visibility to ensure proper propagation to consumers.
  • Relocatable Installation: - Integrated GNUInstallDirs for standard-compliant paths.
    • Set CMAKE_INSTALL_RPATH using $ORIGIN (Linux) and @loader_path (macOS) to ensure the library is relocatable.
  • Config File Modernization: Updated graphar-config.in.cmake using @PACKAGE_INIT@ and find_dependency for robust downstream resolution.
  • Backward Compatibility: Preserved the legacy GRAPHAR_LIBRARIES and GRAPHAR_INCLUDE_DIR variables.

Are these changes tested?

  • Verified that all 20 existing C++ unit tests pass (ctest).
  • Confirmed that make install generates a valid relocatable file structure.
  • Successfully linked a separate "Hello World" project using find_package(graphar REQUIRED).

Are there any user-facing changes?

Yes. Users can now integrate GraphAr into their own projects using the standard CMake pattern:

find_package(graphar REQUIRED)
target_link_libraries(my_app PRIVATE graphar::graphar)

@shivendra-dev54 shivendra-dev54 deleted the 810-improve-cmakelists branch February 28, 2026 19:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant