cmake: expose hdf5 target as SZ3::hdf5sz3 in build and export#128
Merged
cmake: expose hdf5 target as SZ3::hdf5sz3 in build and export#128
Conversation
There was a problem hiding this comment.
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::hdf5sz3for build-tree consumers. - Add
NAMESPACE SZ3::to the build-treeexport(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
hdf5sz3links against the in-tree targetSZ3, but after installation the SZ3 target is exported under theSZ3::namespace (i.e., consumers will haveSZ3::SZ3, notSZ3). This can make the installedSZ3::hdf5sz3imported 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 forSZ3::SZ3if 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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Verification