File tree Expand file tree Collapse file tree 5 files changed +16
-9
lines changed Expand file tree Collapse file tree 5 files changed +16
-9
lines changed Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ if(NOT CMAKE_BUILD_TYPE)
44endif ()
55project (h5fortran
66 LANGUAGES C Fortran
7- VERSION 3.0.4
7+ VERSION 3.1.0
88 DESCRIPTION "thin, light object-oriented HDF5 Fortran interface"
99 HOMEPAGE_URL https://github.com/geospace-code/h5fortran)
1010enable_testing ()
@@ -33,12 +33,11 @@ endif()
3333
3434add_library (h5fortran)
3535target_include_directories (h5fortran
36- PUBLIC ${HDF5_INCLUDE_DIRS}
3736 PRIVATE ${CMAKE_CURRENT_BINARY_DIR} /include # for IBM XL
3837 INTERFACE
3938 $<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR} /include >
4039 $<INSTALL_INTERFACE:include >)
41- target_link_libraries (h5fortran PRIVATE ${HDF5_LIBRARIES} )
40+ target_link_libraries (h5fortran PUBLIC HDF5::HDF5 )
4241set_target_properties (h5fortran PROPERTIES Fortran_MODULE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} /include )
4342add_library (h5fortran::h5fortran ALIAS h5fortran)
4443
Original file line number Diff line number Diff line change @@ -31,8 +31,15 @@ list(REMOVE_DUPLICATES HDF5_INCLUDE_DIRS)
3131
3232set (HDF5_LIBRARIES ${HDF5_Fortran_HL_LIBRARIES} ${HDF5_Fortran_LIBRARIES} ${HDF5_LIBRARIES} )
3333
34- set (CMAKE_REQUIRED_INCLUDES ${HDF5_INCLUDE_DIRS} )
35- set (CMAKE_REQUIRED_LIBRARIES ${HDF5_LIBRARIES} )
34+ # --- make imported target
35+ # NOTE: this is coming to CMake 3.19 FindHDF5, but the alpha didn't work for Intel Windows.
36+ add_library (HDF5::HDF5 INTERFACE IMPORTED )
37+ target_include_directories (HDF5::HDF5 INTERFACE "${HDF5_INCLUDE_DIRS} " )
38+ target_link_libraries (HDF5::HDF5 INTERFACE "${HDF5_LIBRARIES} " )
39+ target_compile_definitions (HDF5::HDF5 INTERFACE "${HDF5_DEFINITIONS} " )
40+
41+ set (CMAKE_REQUIRED_INCLUDES)
42+ set (CMAKE_REQUIRED_LIBRARIES HDF5::HDF5)
3643
3744include (CheckSymbolExists)
3845check_symbol_exists(H5_HAVE_FILTER_SZIP H5pubconf.h use_szip)
@@ -89,6 +96,8 @@ if(MSVC)
8996endif (MSVC )
9097endif ()
9198
99+ # --- configure time checks
100+ # these checks avoid messy, confusing errors at build time
92101
93102include (CheckFortranSourceCompiles)
94103set (_code "program test_minimal
Original file line number Diff line number Diff line change 11project (' h5fortran' , ' fortran' ,
22 meson_version : ' >=0.52.0' ,
3- version : ' 3.0.4 ' ,
3+ version : ' 3.1.0 ' ,
44 default_options : [' default_library=static' , ' buildtype=release' , ' warning_level=3' ])
55
66subdir (' meson' )
Original file line number Diff line number Diff line change 11
22add_executable (proto_file_image file_image.f90)
33target_include_directories (proto_file_image
4- PRIVATE ${HDF5_INCLUDE_DIRS}
54 PRIVATE ${CMAKE_CURRENT_BINARY_DIR} /include ) # for IBM XL
6- target_link_libraries (proto_file_image PRIVATE ${HDF5_LIBRARIES} )
5+ target_link_libraries (proto_file_image PRIVATE HDF5::HDF5 )
76set_target_properties (proto_file_image PROPERTIES Fortran_MODULE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} /include )
87add_test (NAME proto:file_image COMMAND $<TARGET_FILE:proto_file_image>)
Original file line number Diff line number Diff line change @@ -24,6 +24,6 @@ endforeach
2424python = find_program (' python' )
2525
2626test (' check_shape' , python,
27- args : [files (' test_shape.py' )],
27+ args : [files (' test_shape.py' ), meson .build_root() / ' test_shape.h5 ' ],
2828 is_parallel : false ,
2929 suite : ' h5shaky' , priority : - 100 , timeout : 90 )
You can’t perform that action at this time.
0 commit comments