Skip to content

Commit 8d78d83

Browse files
committed
CMake >= 3.19 for robustness
HDF5 is complex enough without adding complexity from ancient CMake need to test
1 parent 3fc5a63 commit 8d78d83

File tree

5 files changed

+12
-16
lines changed

5 files changed

+12
-16
lines changed

CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
cmake_minimum_required(VERSION 3.14...3.28)
1+
cmake_minimum_required(VERSION 3.19...3.28)
22

33
if(CMAKE_SOURCE_DIR STREQUAL CMAKE_BINARY_DIR)
44
message(FATAL_ERROR "Please do out of source build like
@@ -12,7 +12,7 @@ endif()
1212

1313
project(h5fortran
1414
LANGUAGES C Fortran
15-
VERSION 4.10.3
15+
VERSION 4.10.4
1616
)
1717

1818
include(CTest)

cmake/CheckHDF5.cmake

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# HDF5 1.14.0 has a bug where basic types are not correct, which causes confusing runtime errors
22
# check for those and other problems that may arise before build.
33

4-
include(CheckCSourceRuns)
5-
include(CheckFortranSourceRuns)
4+
include(CheckSourceRuns)
5+
66

77
function(check_hdf5_c)
88

@@ -36,7 +36,7 @@ return EXIT_SUCCESS;
3636
}
3737
]=])
3838

39-
check_c_source_runs("${_src}" hdf5_c_types)
39+
check_source_runs(C "${_src}" hdf5_c_types)
4040

4141
if(NOT hdf5_c_types)
4242
message(FATAL_ERROR "HDF5 C types failed check")
@@ -82,7 +82,7 @@ end program
8282
]=]
8383
)
8484

85-
check_fortran_source_runs("${_src}" hdf5_fortran_types)
85+
check_source_runs(Fortran "${_src}" hdf5_fortran_types)
8686

8787
if(NOT hdf5_fortran_types)
8888
message(FATAL_ERROR "HDF5 Fortran types failed check")

cmake/FindHDF5.cmake

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,7 @@ Targets
6060
#]=======================================================================]
6161

6262
include(CheckSymbolExists)
63-
include(CheckCSourceCompiles)
64-
include(CheckFortranSourceCompiles)
63+
include(CheckSourceCompiles)
6564

6665

6766
function(get_flags exec outvar)
@@ -696,7 +695,7 @@ else()
696695
]=])
697696
endif(HDF5_parallel_FOUND)
698697

699-
check_c_source_compiles("${src}" HDF5_C_links)
698+
check_source_compiles(C "${src}" HDF5_C_links)
700699

701700
endfunction(check_c_links)
702701

@@ -737,7 +736,7 @@ else()
737736
end program")
738737
endif()
739738

740-
check_fortran_source_compiles(${src} HDF5_Fortran_links SRC_EXT f90)
739+
check_source_compiles(Fortran ${src} HDF5_Fortran_links)
741740

742741
endfunction(check_fortran_links)
743742

cmake/compilers.cmake

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
include(CheckFortranSourceCompiles)
1+
include(CheckSourceCompiles)
22

33
# --- not all platforms have ieee_arithmetic e.g. aarch64 GCC
4-
check_fortran_source_compiles("program a
4+
check_source_compiles(Fortran
5+
"program a
56
use, intrinsic :: ieee_arithmetic, only : ieee_quiet_nan, ieee_value
67
real :: NaN
78
NaN = ieee_value(0., ieee_quiet_nan)
89
end program"
910
HAVE_IEEE_ARITH
10-
SRC_EXT f90
1111
)
1212

1313
# --- C compile flags

options.cmake

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,6 @@ option(concepts "conceptual testing, for devs only" off)
1010

1111
option(CMAKE_TLS_VERIFY "Verify TLS certificates" on)
1212

13-
include(GNUInstallDirs)
14-
15-
1613
if(BUILD_SHARED_LIBS AND MSVC)
1714
message(WARNING "Intel oneAPI has trouble with shared libs in general on Windows, try
1815
cmake -DBUILD_SHARED_LIBS=off")

0 commit comments

Comments
 (0)