Skip to content

Commit

Permalink
Revert "cmake: making hdf5OK test soft-fail, and more reliable"
Browse files Browse the repository at this point in the history
This reverts commit 12e0137.
  • Loading branch information
scivision committed Apr 8, 2020
1 parent 12e0137 commit d1ac712
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
11 changes: 9 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ if(NOT CMAKE_BUILD_TYPE)
endif()
project(h5fortran
LANGUAGES C Fortran
VERSION 2.9.1
VERSION 2.9.0
DESCRIPTION "thin, light object-oriented HDF5 Fortran interface"
HOMEPAGE_URL https://github.com/scivision/h5fortran)
enable_testing()
Expand All @@ -19,11 +19,18 @@ include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/compilers.cmake)
include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/hdf5.cmake)

if(NOT HDF5OK)
message(WARNING "HDF5 library may not work with ${CMAKE_Fortran_COMPILER_ID} ${CMAKE_Fortran_COMPILER_VERSION}")

message(STATUS "HDF5 library not working with ${CMAKE_Fortran_COMPILER_ID} ${CMAKE_Fortran_COMPILER_VERSION}")

if(PROJECT_SOURCE_DIR STREQUAL CMAKE_SOURCE_DIR)
message(FATAL_ERROR)
endif()

unset(h5fortran)
unset(h5fortran::fortran)
message(STATUS "h5fortran disabled")
return()

endif(NOT HDF5OK)

set(CTEST_TEST_TIMEOUT 15)
Expand Down
2 changes: 1 addition & 1 deletion cmake/hdf5.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ endif()
set(THREADS_PREFER_PTHREAD_FLAG true)
find_package(Threads)
if(Threads_FOUND)
list(APPEND HDF5_LIBRARIES ${CMAKE_THREAD_LIBS_INIT}) # CMAKE_THREAD_LIBS_INIT is more reliable than Threads::Threads
list(APPEND HDF5_LIBRARIES Threads::Threads)
endif()

list(APPEND HDF5_LIBRARIES ${CMAKE_DL_LIBS})
Expand Down
2 changes: 1 addition & 1 deletion meson.build
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
project('h5fortran', 'fortran',
meson_version : '>=0.52.0',
version : '2.9.1',
version : '2.9.0',
default_options : ['default_library=static', 'buildtype=release', 'warning_level=3'])

subdir('meson')
Expand Down

0 comments on commit d1ac712

Please sign in to comment.