From d1ac712fd23f4813b2e6e640d760e3c175c86b8c Mon Sep 17 00:00:00 2001 From: Michael Hirsch Date: Wed, 8 Apr 2020 18:02:12 -0400 Subject: [PATCH] Revert "cmake: making hdf5OK test soft-fail, and more reliable" This reverts commit 12e0137b839c8b1c2d02ce44dc851dff658def0d. --- CMakeLists.txt | 11 +++++++++-- cmake/hdf5.cmake | 2 +- meson.build | 2 +- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index d035d2b3..d39f1caf 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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() @@ -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) diff --git a/cmake/hdf5.cmake b/cmake/hdf5.cmake index 574f849c..104c3522 100644 --- a/cmake/hdf5.cmake +++ b/cmake/hdf5.cmake @@ -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}) diff --git a/meson.build b/meson.build index 8eea7889..8c2bb05f 100644 --- a/meson.build +++ b/meson.build @@ -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')