Symptom
CMake configure warning (visible now that BUILD_EXAMPLES=ON is default, #278):
CMake Warning (dev) at examples/CMakeLists.txt:27 (find_package):
Policy CMP0074 is not set: find_package uses <PackageName>_ROOT variables.
CMake variable HDF5_ROOT is set to: /usr/local/HDF_Group/HDF5/1.12.3;/usr/local;/usr
For compatibility, CMake is ignoring the variable.
Root cause — not just cosmetic
examples/CMakeLists.txt:5 declares cmake_minimum_required(VERSION 3.10 FATAL_ERROR). CMP0074 was introduced in CMake 3.12, so under a 3.10 policy baseline it defaults to OLD and find_package(HDF5) ignores HDF5_ROOT. The file carefully builds HDF5_ROOT (lines 20-25) to prefer custom HDF Group installs — that logic is silently inert. The root CMakeLists.txt already requires 3.22; the examples sub-project's stale 3.10 baseline is the only thing forcing the old behavior.
Fix
Set cmake_policy(SET CMP0074 NEW) in examples/CMakeLists.txt (after project()), so find_package honors HDF5_ROOT. Silences the warning and makes the custom-path discovery actually work.
Acceptance
- No
CMP0074 dev warning at configure.
find_package(HDF5) in examples honors HDF5_ROOT.
Symptom
CMake configure warning (visible now that
BUILD_EXAMPLES=ONis default, #278):Root cause — not just cosmetic
examples/CMakeLists.txt:5declarescmake_minimum_required(VERSION 3.10 FATAL_ERROR). CMP0074 was introduced in CMake 3.12, so under a 3.10 policy baseline it defaults to OLD andfind_package(HDF5)ignoresHDF5_ROOT. The file carefully buildsHDF5_ROOT(lines 20-25) to prefer custom HDF Group installs — that logic is silently inert. The rootCMakeLists.txtalready requires 3.22; the examples sub-project's stale 3.10 baseline is the only thing forcing the old behavior.Fix
Set
cmake_policy(SET CMP0074 NEW)inexamples/CMakeLists.txt(afterproject()), sofind_packagehonorsHDF5_ROOT. Silences the warning and makes the custom-path discovery actually work.Acceptance
CMP0074dev warning at configure.find_package(HDF5)in examples honorsHDF5_ROOT.