Skip to content

Commit 1a45b77

Browse files
committed
cmake: use native instead of custom
1 parent a58cc2d commit 1a45b77

26 files changed

+36
-40
lines changed

.github/workflows/ci_linux_meson.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ on:
44
push:
55
paths:
66
- "**.build"
7-
- "**.f90"
87
- ".github/workflows/ci_linux_meson.yml"
98
pull_request:
109

CMakeLists.txt

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,12 @@ if(NOT CMAKE_BUILD_TYPE)
44
endif()
55
project(h5fortran
66
LANGUAGES C Fortran
7-
VERSION 2.9.1
7+
VERSION 2.9.2
88
DESCRIPTION "thin, light object-oriented HDF5 Fortran interface"
99
HOMEPAGE_URL https://github.com/scivision/h5fortran)
1010
enable_testing()
1111
include(CTest)
12+
include(FeatureSummary)
1213

1314
option(test_shaky "run shaky tests" OFF)
1415

@@ -19,19 +20,11 @@ include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/compilers.cmake)
1920
include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/hdf5.cmake)
2021

2122
if(NOT HDF5OK)
22-
23-
message(STATUS "HDF5 library not working with ${CMAKE_Fortran_COMPILER_ID} ${CMAKE_Fortran_COMPILER_VERSION}")
24-
25-
if(PROJECT_SOURCE_DIR STREQUAL CMAKE_SOURCE_DIR)
26-
message(FATAL_ERROR)
23+
message(STATUS "h5fortran: HDF5 not working")
24+
if(NOT PROJECT_SOURCE_DIR STREQUAL CMAKE_SOURCE_DIR)
25+
return()
2726
endif()
28-
29-
unset(h5fortran)
30-
unset(h5fortran::fortran)
31-
message(STATUS "h5fortran disabled")
32-
return()
33-
34-
endif(NOT HDF5OK)
27+
endif()
3528

3629
set(CTEST_TEST_TIMEOUT 15)
3730

@@ -55,7 +48,6 @@ if(PROJECT_SOURCE_DIR STREQUAL CMAKE_SOURCE_DIR)
5548

5649
include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/install.cmake)
5750

58-
include(FeatureSummary)
5951
set_package_properties(Threads PROPERTIES DESCRIPTION "the system threads library")
6052
set_package_properties(HDF5 PROPERTIES URL "https://hdfgroup.org/" DESCRIPTION "fast, versatile file I/O format" TYPE REQUIRED)
6153
set_package_properties(ZLIB PROPERTIES URL "https://www.zlib.net/" DESCRIPTION "patent-free compression library")

cmake/compilers.cmake

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ elseif(CMAKE_Fortran_COMPILER_ID STREQUAL NAG)
3333
endif()
3434

3535
include(CheckFortranSourceCompiles)
36-
check_fortran_source_compiles("implicit none (external); end" f2018impnone SRC_EXT f90)
36+
check_fortran_source_compiles("implicit none (type, external); end" f2018impnone SRC_EXT f90)
3737
if(NOT f2018impnone)
38-
message(FATAL_ERROR "Compiler does not support Fortran 2018 IMPLICIT NONE (EXTERNAL): ${CMAKE_Fortran_COMPILER_ID} ${CMAKE_Fortran_COMPILER_VERSION}")
38+
message(FATAL_ERROR "Compiler does not support Fortran 2018 implicit none (type, external): ${CMAKE_Fortran_COMPILER_ID} ${CMAKE_Fortran_COMPILER_VERSION}")
3939
endif()

cmake/hdf5.cmake

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,12 @@ if(WIN32 AND CMAKE_Fortran_COMPILER_ID STREQUAL Intel)
77
set(HDF5_USE_STATIC_LIBRARIES false)
88
endif()
99

10-
find_package(HDF5 COMPONENTS Fortran HL)
10+
if(PROJECT_SOURCE_DIR STREQUAL CMAKE_SOURCE_DIR)
11+
find_package(HDF5 COMPONENTS Fortran HL REQUIRED)
12+
else()
13+
find_package(HDF5 COMPONENTS Fortran HL)
14+
endif()
15+
1116
if(NOT HDF5_FOUND)
1217
return()
1318
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.1',
3+
version : '2.9.2',
44
default_options : ['default_library=static', 'buildtype=release', 'warning_level=3'])
55

66
subdir('meson')

src/interface.f90

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ module h5fortran
1616

1717
use string_utils, only : toLower, strip_trailing_null, truncate_string_null
1818

19-
implicit none (external)
19+
implicit none (type, external)
2020
private
2121
public :: hdf5_file, toLower, hdf_shape_check, hdf_get_slice, hdf_wrapup, hsize_t, strip_trailing_null, truncate_string_null, &
2222
check, h5write, h5read

src/read.f90

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
h5pget_layout_f, h5pget_chunk_f, H5D_CONTIGUOUS_F, H5D_CHUNKED_F
55
use H5LT, only : h5ltpath_valid_f
66

7-
implicit none (external)
7+
implicit none (type, external)
88

99
contains
1010

src/reader.f90

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
use hdf5, only : h5dread_f
55
use h5lt, only : h5ltread_dataset_string_f
66

7-
implicit none (external)
7+
implicit none (type, external)
88

99
contains
1010

src/reader_lt.f90

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
submodule (h5fortran:read) reader_lt
22

3-
implicit none (external)
3+
implicit none (type, external)
44

55
contains
66

src/reader_nd.f90

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
!! conceptual--not tested--will use h5dread_f instead
22
submodule (h5fortran:read) reader_ND
33

4-
implicit none (external)
4+
implicit none (type, external)
55

66
contains
77

0 commit comments

Comments
 (0)