Skip to content

[#295]:svarga:build, honor CMP0074 so examples find_package respects HDF5_ROOT#296

Merged
steven-varga merged 1 commit into
stagingfrom
295-fix-cmp0074
May 30, 2026
Merged

[#295]:svarga:build, honor CMP0074 so examples find_package respects HDF5_ROOT#296
steven-varga merged 1 commit into
stagingfrom
295-fix-cmp0074

Conversation

@steven-varga
Copy link
Copy Markdown
Collaborator

Closes #295.

Problem

A CMake dev warning at configure (surfaced by the BUILD_EXAMPLES=ON default, #278):

CMake Warning (dev) at examples/CMakeLists.txt:27 (find_package):
  Policy CMP0074 is not set ... CMake is ignoring the variable HDF5_ROOT

examples/CMakeLists.txt declares cmake_minimum_required(VERSION 3.10), which predates CMP0074 (3.12). Under that baseline the policy defaults to OLD, so find_package(HDF5) ignores the HDF5_ROOT the file builds (lines 20-25) for custom HDF Group installs — the discovery logic was silently inert.

Fix

cmake_policy(SET CMP0074 NEW) after project() (guarded with if(POLICY ...)).

Verification

Configure with HDF5_ROOT set: 0 CMP0074 warnings, 0 CMake warnings, HDF5 found, no "ignoring the variable" message.

@codecov
Copy link
Copy Markdown

codecov Bot commented May 30, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@steven-varga steven-varga merged commit 22800d6 into staging May 30, 2026
18 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.

1 participant