Skip to content

Commit c0d39c5

Browse files
committed
better HDF5 for Intel windows
1 parent b0f7fce commit c0d39c5

File tree

3 files changed

+15
-8
lines changed

3 files changed

+15
-8
lines changed

CMakeLists.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,13 @@ include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/hdf5.cmake)
2121

2222
if(NOT HDF5OK)
2323
message(STATUS "h5fortran: HDF5 not working")
24-
if(NOT PROJECT_SOURCE_DIR STREQUAL CMAKE_SOURCE_DIR)
24+
if(PROJECT_SOURCE_DIR STREQUAL CMAKE_SOURCE_DIR)
25+
message(FATAL_ERROR)
26+
else()
2527
return()
2628
endif()
2729
endif()
2830

29-
set(CTEST_TEST_TIMEOUT 15)
30-
3131
# --- build
3232

3333
add_library(h5fortran)

cmake/hdf5.cmake

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,17 @@ if(UNIX)
5454
list(APPEND HDF5_LIBRARIES m)
5555
endif()
5656

57+
if(WIN32 AND MSVC)
58+
# this stanza must be BEFORE if(DEFINED HDF5OK)
59+
if(NOT DEFINED HDF5_ROOT AND DEFINED ENV{HDF5_ROOT})
60+
file(TO_CMAKE_PATH "$ENV{HDF5_ROOT}" HDF5_ROOT)
61+
endif()
62+
63+
if(DEFINED HDF5_ROOT)
64+
set(ENV{PATH} "${HDF5_ROOT}/bin;$ENV{PATH}")
65+
endif()
66+
endif()
67+
5768
if(DEFINED HDF5OK)
5869
return()
5970
endif()

src/tests/CMakeLists.txt

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,16 +50,12 @@ set_tests_properties(h5fortran:ShapeCheck PROPERTIES
5050
SKIP_RETURN_CODE 77)
5151

5252
if(WIN32 AND MSVC)
53-
if(NOT DEFINED HDF5_ROOT AND DEFINED ENV{HDF5_ROOT})
54-
file(TO_CMAKE_PATH "$ENV{HDF5_ROOT}" HDF5_ROOT)
55-
endif()
56-
5753
foreach(t h5fortran:minimal h5fortran:ErrorCheck h5fortran:test_exist h5fortran:module h5fortran:deflate h5fortran:ShapeCheck)
5854
set_tests_properties(${t} PROPERTIES ENVIRONMENT "PATH=${HDF5_ROOT}/bin;$ENV{PATH}")
5955
endforeach()
6056
endif()
6157

62-
# ---
58+
# --- shaky tests
6359
if(NOT test_shaky)
6460
return()
6561
endif()

0 commit comments

Comments
 (0)