Skip to content

Conversation

@mattjala
Copy link
Contributor

@mattjala mattjala commented Dec 8, 2025

If the cacheinit.cmake file is used, the library sets an OS-specific Debug build library postfix if none is provided by the user. However, the way this check is done means that if a user manually provides an empty string value for the postfix, it will be detected the same as an unprovided postfix and replaced. This is likely to lead to confusion, since the user manually specified an empty postfix but instead receives the default postfixes.

This updates the check to distinguish between a user-provided empty postfix and an undefined postfix.

I also removed an old postfix check from an examples counterpart of the HDF_DIR_PATHS macro in HDF5Examples/config/HDFMacros.cmake, since it appears that this was copied and became out of date with the modern version of the macro in HDFMacros.cmake.

Resolves a secondary issues brought up in #6087

@Andrej730
Copy link

Please consider returning debug postfix for Windows by default - it was convenient and was preventing running into errors, see the reasoning in

Okay. That's a bit unforunate then - it makes sense for Unix, where Release and Debug binaries are compatible, but on Windows they're not and not using debug postfix for them is a common source of confusion, leading to linking errors (e.g. Release libhdf5_cpp.lib has /FAILIFMISMATCH:_ITERATOR_DEBUG_LEVEL=0 that will prevent in from being linked to Debug build and vice versa).

With debug postfix it's possible to install both Release and Debug builds to the same folder and let cmake figure out which ones to use - since it will have both hdf5-targets-release.cmake and hdf5-targets-debug.cmake configs with separated paths to libraries, you don't really need to change build/link process and provide debug postfix yourself.

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

Labels

Projects

Status: In progress

Development

Successfully merging this pull request may close these issues.

2 participants