Skip to content

Commit b0f7fce

Browse files
committed
add hdf5 run test
1 parent 9f80a3d commit b0f7fce

File tree

5 files changed

+20
-7
lines changed

5 files changed

+20
-7
lines changed

CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
cmake_minimum_required(VERSION 3.13) # 3.13 for target_sources() absolute
1+
cmake_minimum_required(VERSION 3.14)
22
if(NOT CMAKE_BUILD_TYPE)
33
set(CMAKE_BUILD_TYPE Release CACHE STRING "Debug or Release")
44
endif()
55
project(h5fortran
66
LANGUAGES C Fortran
7-
VERSION 2.9.4
7+
VERSION 2.10.0
88
DESCRIPTION "thin, light object-oriented HDF5 Fortran interface"
99
HOMEPAGE_URL https://github.com/geospace-code/h5fortran)
1010
enable_testing()

cmake/hdf5.cmake

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,4 +73,13 @@ set(CMAKE_REQUIRED_LIBRARIES ${HDF5_LIBRARIES})
7373

7474
include(CheckFortranSourceCompiles)
7575
file(READ ${CMAKE_CURRENT_SOURCE_DIR}/src/tests/test_minimal.f90 _code)
76-
check_fortran_source_compiles(${_code} HDF5OK SRC_EXT f90)
76+
check_fortran_source_compiles(${_code} HDF5_compiles_ok SRC_EXT f90)
77+
78+
include(CheckFortranSourceRuns)
79+
file(READ ${CMAKE_CURRENT_SOURCE_DIR}/src/tests/test_minimal.f90 _code)
80+
check_fortran_source_runs(${_code} HDF5_runs_ok SRC_EXT f90)
81+
82+
set(HDF5OK false)
83+
if(HDF5_compiles_ok AND HDF5_runs_ok)
84+
set(HDF5OK true CACHE BOOL "HDF5 library compiles and run OK" FORCE)
85+
endif()

meson.build

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
project('h5fortran', 'fortran',
22
meson_version : '>=0.52.0',
3-
version : '2.9.4',
3+
version : '2.10.0',
44
default_options : ['default_library=static', 'buildtype=release', 'warning_level=3'])
55

66
subdir('meson')

meson/meson.build

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@ if not fc.links(files('../src/tests/test_minimal.f90'), dependencies: hdf5, name
1717
hdf5 = disabler()
1818
endif
1919

20+
if (fc.run(files('../src/tests/test_minimal.f90'), dependencies: hdf5, name: 'HDF5').returncode() != 0)
21+
hdf5 = disabler()
22+
endif
23+
2024
if not meson.is_subproject()
2125
assert(hdf5.found(), 'hdf5 library is required for h5fortran')
22-
endif
26+
endif

setup.cmake

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ set(_opts)
77

88
# --- boilerplate follows
99
message(STATUS "CMake ${CMAKE_VERSION}")
10-
if(CMAKE_VERSION VERSION_LESS 3.13)
11-
message(FATAL_ERROR "Please update CMake >= 3.13")
10+
if(CMAKE_VERSION VERSION_LESS 3.14)
11+
message(FATAL_ERROR "Please update CMake >= 3.14")
1212
endif()
1313

1414
# site is OS name

0 commit comments

Comments
 (0)