summaryrefslogtreecommitdiff
path: root/dev-build/cmake/files/cmake-3.31.7-hdf5.patch
blob: c68c5eeec986566ce249ff5ee998e3b4f3ba6f6d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
https://bugs.gentoo.org/954378#c14
https://gitlab.kitware.com/cmake/cmake/-/issues/23261
https://gitlab.kitware.com/cmake/cmake/-/commit/a869b79c5921412c91fb71a761748ae5f7d3fb23

From a869b79c5921412c91fb71a761748ae5f7d3fb23 Mon Sep 17 00:00:00 2001
From: Atri Bhattacharya <badshah400@gmail.org>
Date: Mon, 10 Mar 2025 20:55:36 +0530
Subject: [PATCH] FindHDF5: Prefer h5hl* compilers for HDF5_FIND_HL

Prefer `h5hlcc`, `h5hlc++`, and `h5hlfc` compilers when HDF5's HL libraries
are requested. These include the `-lhdf_hl` in the command line, whereas
the non-hl compilers (like `h5cc`) do not. Using the latter, therefore,
leads to cmake complaining about not finding the `HDF5_HL` libraries even
though they are present in the same location as the `hdf5` library itself.

Fixes: #23261
--- a/Modules/FindHDF5.cmake
+++ b/Modules/FindHDF5.cmake
@@ -218,6 +218,13 @@ else()
   set(HDF5_Fortran_COMPILER_NAMES h5fc h5pfc)
 endif()
 
+# Prefer h5hl<LANG> compilers if HDF5_FIND_HL is enabled
+if(HDF5_FIND_HL)
+  list(PREPEND HDF5_C_COMPILER_NAMES h5hlcc)
+  list(PREPEND HDF5_CXX_COMPILER_NAMES h5hlc++)
+  list(PREPEND HDF5_Fortran_COMPILER_NAMES h5hlfc)
+endif()
+
 # Test first if the current compilers automatically wrap HDF5
 function(_HDF5_test_regular_compiler_C success version is_parallel)
   if(NOT ${success} OR
-- 
GitLab