Skip to content

cmake: expose hdf5 target as SZ3::hdf5sz3 in build and export#128

Merged
ayzk merged 1 commit intomasterfrom
codex/hdf5sz3-namespaced-target
Mar 2, 2026
Merged

cmake: expose hdf5 target as SZ3::hdf5sz3 in build and export#128
ayzk merged 1 commit intomasterfrom
codex/hdf5sz3-namespaced-target

Conversation

@ayzk
Copy link
Collaborator

@ayzk ayzk commented Mar 2, 2026

Summary

  • add in-tree alias target SZ3::hdf5sz3 for FetchContent/build-tree consumers
  • export hdf5sz3 with NAMESPACE SZ3:: in HDF5SZ3.cmake

Verification

  • built test1 (FetchContent)
  • built/install SZ3 with -DBUILD_H5Z_FILTER=ON
  • built test2 (find_package) against installed package

Copilot AI review requested due to automatic review settings March 2, 2026 13:53
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR aims to make the HDF5 filter target available under a consistent SZ3:: namespaced name for both in-tree (FetchContent/add_subdirectory) and exported/build-tree usage, aligning it with how SZ3 exports targets for find_package.

Changes:

  • Add an in-tree alias target SZ3::hdf5sz3 for build-tree consumers.
  • Add NAMESPACE SZ3:: to the build-tree export(TARGETS ...) call so the exported target name matches the installed/exported naming.
Comments suppressed due to low confidence (1)

tools/H5Z-SZ3/CMakeLists.txt:19

  • hdf5sz3 links against the in-tree target SZ3, but after installation the SZ3 target is exported under the SZ3:: namespace (i.e., consumers will have SZ3::SZ3, not SZ3). This can make the installed SZ3::hdf5sz3 imported target reference a non-existent dependency (or fall back to -lSZ3, which is wrong for an INTERFACE library). Update the link interface to use the exported name (and add an in-tree ALIAS for SZ3::SZ3 if needed for build-tree/FetchContent usage) so installed and in-tree consumers behave consistently.
add_library(SZ3::hdf5sz3 ALIAS hdf5sz3)

target_link_libraries(hdf5sz3
        PUBLIC SZ3 HDF5::HDF5
)

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@ayzk ayzk merged commit 34b36f2 into master Mar 2, 2026
17 checks passed
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.

2 participants