File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change 1+ # don't enclose this all in "if(NOT DEFINED HDF5OK)" because CMake intermittantly doesn't cache needed HDF5 variables.
12if (BUILD_SHARED_LIBS )
23 set (HDF5_USE_STATIC_LIBRARIES false )
34else ()
@@ -15,7 +16,9 @@ if(WIN32)
1516 endif ()
1617endif ()
1718
18- message (STATUS "HDF5 includes: ${HDF5_INCLUDE_DIRS} ${HDF5_Fortran_INCLUDE_DIRS} " )
19+ if (NOT DEFINED HDF5OK)
20+
21+ message (STATUS "HDF5 include: ${HDF5_INCLUDE_DIRS} ${HDF5_Fortran_INCLUDE_DIRS} " )
1922message (STATUS "HDF5 library: ${HDF5_Fortran_LIBRARIES} " )
2023message (STATUS "HDF5 H5LT library: ${HDF5_Fortran_HL_LIBRARIES} " )
2124if (HDF5_Fortran_COMPILER_EXECUTABLE)
@@ -24,13 +27,16 @@ endif()
2427if (HDF5_Fortran_DEFINITIONS)
2528 message (STATUS "HDF5 compiler defs: ${HDF5_Fortran_DEFINITIONS} " )
2629endif ()
30+ endif ()
2731
2832set (CMAKE_REQUIRED_INCLUDES ${HDF5_INCLUDE_DIRS} ${HDF5_Fortran_INCLUDE_DIRS} )
2933set (CMAKE_REQUIRED_LIBRARIES ${HDF5_Fortran_HL_LIBRARIES} ${HDF5_Fortran_LIBRARIES} )
3034
3135include (CheckFortranSourceCompiles)
32- check_fortran_source_compiles("use h5lt; end" hasHDF5 SRC_EXT f90)
36+ check_fortran_source_compiles("use h5lt; end" HDF5OK SRC_EXT f90)
37+
38+ set (HDF5OK ${HDF5OK} CACHE BOOL "HDF5 library working?" )
3339
34- if (NOT hasHDF5 )
40+ if (NOT HDF5OK )
3541 message (WARNING "HDF5 library may not be working with ${CMAKE_Fortran_COMPILER_ID} ${CMAKE_Fortran_COMPILER_VERSION} " )
3642endif ()
You can’t perform that action at this time.
0 commit comments