Skip to content

Commit ef56653

Browse files
committed
[#295]:svarga:build, honor CMP0074 so examples find_package respects HDF5_ROOT
1 parent db16477 commit ef56653

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

examples/CMakeLists.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,13 @@ cmake_minimum_required(VERSION 3.10 FATAL_ERROR)
77
## match hdf5 versioning x.x.x.h5cpp-version
88
project(h5cpp-examples VERSION 1.10.4.5 LANGUAGES CXX C)
99

10+
# Honor <PackageName>_ROOT (CMP0074, CMake 3.12+). The cmake_minimum_required
11+
# above predates it, so without this find_package(HDF5) below would silently
12+
# ignore the HDF5_ROOT we build for custom HDF Group installs. (#295)
13+
if(POLICY CMP0074)
14+
cmake_policy(SET CMP0074 NEW)
15+
endif()
16+
1017
# check if the correct version of hdf5 available
1118
set(H5CPP_VERSION ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH})
1219

0 commit comments

Comments
 (0)