Skip to content

Commit

Permalink
better HDF5 for Intel windows
Browse files Browse the repository at this point in the history
  • Loading branch information
scivision committed Jul 9, 2020
1 parent b0f7fce commit c0d39c5
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 8 deletions.
6 changes: 3 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@ include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/hdf5.cmake)

if(NOT HDF5OK)
message(STATUS "h5fortran: HDF5 not working")
if(NOT PROJECT_SOURCE_DIR STREQUAL CMAKE_SOURCE_DIR)
if(PROJECT_SOURCE_DIR STREQUAL CMAKE_SOURCE_DIR)
message(FATAL_ERROR)
else()
return()
endif()
endif()

set(CTEST_TEST_TIMEOUT 15)

# --- build

add_library(h5fortran)
Expand Down
11 changes: 11 additions & 0 deletions cmake/hdf5.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,17 @@ if(UNIX)
list(APPEND HDF5_LIBRARIES m)
endif()

if(WIN32 AND MSVC)
# this stanza must be BEFORE if(DEFINED HDF5OK)
if(NOT DEFINED HDF5_ROOT AND DEFINED ENV{HDF5_ROOT})
file(TO_CMAKE_PATH "$ENV{HDF5_ROOT}" HDF5_ROOT)
endif()

if(DEFINED HDF5_ROOT)
set(ENV{PATH} "${HDF5_ROOT}/bin;$ENV{PATH}")
endif()
endif()

if(DEFINED HDF5OK)
return()
endif()
Expand Down
6 changes: 1 addition & 5 deletions src/tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -50,16 +50,12 @@ set_tests_properties(h5fortran:ShapeCheck PROPERTIES
SKIP_RETURN_CODE 77)

if(WIN32 AND MSVC)
if(NOT DEFINED HDF5_ROOT AND DEFINED ENV{HDF5_ROOT})
file(TO_CMAKE_PATH "$ENV{HDF5_ROOT}" HDF5_ROOT)
endif()

foreach(t h5fortran:minimal h5fortran:ErrorCheck h5fortran:test_exist h5fortran:module h5fortran:deflate h5fortran:ShapeCheck)
set_tests_properties(${t} PROPERTIES ENVIRONMENT "PATH=${HDF5_ROOT}/bin;$ENV{PATH}")
endforeach()
endif()

# ---
# --- shaky tests
if(NOT test_shaky)
return()
endif()
Expand Down

0 comments on commit c0d39c5

Please sign in to comment.