Skip to content

Commit f5a6b40

Browse files
committed
cmake: control verbosity
1 parent 5ab73c1 commit f5a6b40

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

cmake/hdf5.cmake

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
# don't enclose this all in "if(NOT DEFINED HDF5OK)" because CMake intermittantly doesn't cache needed HDF5 variables.
12
if(BUILD_SHARED_LIBS)
23
set(HDF5_USE_STATIC_LIBRARIES false)
34
else()
@@ -15,7 +16,9 @@ if(WIN32)
1516
endif()
1617
endif()
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}")
1922
message(STATUS "HDF5 library: ${HDF5_Fortran_LIBRARIES}")
2023
message(STATUS "HDF5 H5LT library: ${HDF5_Fortran_HL_LIBRARIES}")
2124
if(HDF5_Fortran_COMPILER_EXECUTABLE)
@@ -24,13 +27,16 @@ endif()
2427
if(HDF5_Fortran_DEFINITIONS)
2528
message(STATUS "HDF5 compiler defs: ${HDF5_Fortran_DEFINITIONS}")
2629
endif()
30+
endif()
2731

2832
set(CMAKE_REQUIRED_INCLUDES ${HDF5_INCLUDE_DIRS} ${HDF5_Fortran_INCLUDE_DIRS})
2933
set(CMAKE_REQUIRED_LIBRARIES ${HDF5_Fortran_HL_LIBRARIES} ${HDF5_Fortran_LIBRARIES})
3034

3135
include(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}")
3642
endif()

0 commit comments

Comments
 (0)