|
|
@@ -219,7 +219,7 @@ endif()
|
|
|
function(_HDF5_test_regular_compiler_C success version is_parallel)
|
|
|
if(NOT ${success} OR
|
|
|
NOT EXISTS ${_HDF5_TEST_DIR}/compiler_has_h5_c)
|
|
|
- file(WRITE "${_HDF5_TEST_SRC}"
|
|
|
+ file(WRITE "${_HDF5_TEST_DIR}/${_HDF5_TEST_SRC}"
|
|
|
"#include <hdf5.h>\n"
|
|
|
"const char* info_ver = \"INFO\" \":\" H5_VERSION;\n"
|
|
|
"#ifdef H5_HAVE_PARALLEL\n"
|
|
|
@@ -235,7 +235,7 @@ function(_HDF5_test_regular_compiler_C success version is_parallel)
|
|
|
" fid = H5Fcreate(\"foo.h5\",H5F_ACC_TRUNC,H5P_DEFAULT,H5P_DEFAULT);\n"
|
|
|
" return 0;\n"
|
|
|
"}")
|
|
|
- try_compile(${success} SOURCES "${_HDF5_TEST_SRC}"
|
|
|
+ try_compile(${success} SOURCES "${_HDF5_TEST_DIR}/${_HDF5_TEST_SRC}"
|
|
|
COPY_FILE ${_HDF5_TEST_DIR}/compiler_has_h5_c
|
|
|
)
|
|
|
endif()
|
|
|
@@ -263,7 +263,7 @@ endfunction()
|
|
|
function(_HDF5_test_regular_compiler_CXX success version is_parallel)
|
|
|
if(NOT ${success} OR
|
|
|
NOT EXISTS ${_HDF5_TEST_DIR}/compiler_has_h5_cxx)
|
|
|
- file(WRITE "${_HDF5_TEST_SRC}"
|
|
|
+ file(WRITE "${_HDF5_TEST_DIR}/${_HDF5_TEST_SRC}"
|
|
|
"#include <H5Cpp.h>\n"
|
|
|
"#ifndef H5_NO_NAMESPACE\n"
|
|
|
"using namespace H5;\n"
|
|
|
@@ -281,7 +281,7 @@ function(_HDF5_test_regular_compiler_CXX success version is_parallel)
|
|
|
" H5File file(\"foo.h5\", H5F_ACC_TRUNC);\n"
|
|
|
" return 0;\n"
|
|
|
"}")
|
|
|
- try_compile(${success} SOURCES "${_HDF5_TEST_SRC}"
|
|
|
+ try_compile(${success} SOURCES "${_HDF5_TEST_DIR}/${_HDF5_TEST_SRC}"
|
|
|
COPY_FILE ${_HDF5_TEST_DIR}/compiler_has_h5_cxx
|
|
|
)
|
|
|
endif()
|
|
|
@@ -308,14 +308,14 @@ endfunction()
|
|
|
|
|
|
function(_HDF5_test_regular_compiler_Fortran success is_parallel)
|
|
|
if(NOT ${success})
|
|
|
- file(WRITE "${_HDF5_TEST_SRC}"
|
|
|
+ file(WRITE "${_HDF5_TEST_DIR}/${_HDF5_TEST_SRC}"
|
|
|
"program hdf5_hello\n"
|
|
|
" use hdf5\n"
|
|
|
" integer error\n"
|
|
|
" call h5open_f(error)\n"
|
|
|
" call h5close_f(error)\n"
|
|
|
"end\n")
|
|
|
- try_compile(${success} SOURCES "${_HDF5_TEST_SRC}")
|
|
|
+ try_compile(${success} SOURCES "${_HDF5_TEST_DIR}/${_HDF5_TEST_SRC}")
|
|
|
if(${success})
|
|
|
execute_process(COMMAND ${CMAKE_Fortran_COMPILER} -showconfig
|
|
|
OUTPUT_VARIABLE config_output
|
|
|
@@ -356,9 +356,13 @@ function( _HDF5_invoke_compiler language output_var return_value_var version_var
|
|
|
ERROR_VARIABLE output
|
|
|
RESULT_VARIABLE return_value
|
|
|
)
|
|
|
- if(return_value AND NOT HDF5_FIND_QUIETLY)
|
|
|
- message(STATUS
|
|
|
- "HDF5 ${language} compiler wrapper is unable to compile a minimal HDF5 program.")
|
|
|
+ if(NOT return_value EQUAL 0)
|
|
|
+ message(CONFIGURE_LOG
|
|
|
+ "HDF5 ${language} compiler wrapper is unable to compile a minimal HDF5 program.\n\n${output}")
|
|
|
+ if(NOT HDF5_FIND_QUIETLY)
|
|
|
+ message(STATUS
|
|
|
+ "HDF5 ${language} compiler wrapper is unable to compile a minimal HDF5 program.")
|
|
|
+ endif()
|
|
|
else()
|
|
|
execute_process(
|
|
|
COMMAND ${HDF5_${language}_COMPILER_EXECUTABLE} -show ${lib_type_args} "${_HDF5_TEST_SRC}"
|
|
|
@@ -368,9 +372,13 @@ function( _HDF5_invoke_compiler language output_var return_value_var version_var
|
|
|
RESULT_VARIABLE return_value
|
|
|
OUTPUT_STRIP_TRAILING_WHITESPACE
|
|
|
)
|
|
|
- if(return_value AND NOT HDF5_FIND_QUIETLY)
|
|
|
- message(STATUS
|
|
|
- "Unable to determine HDF5 ${language} flags from HDF5 wrapper.")
|
|
|
+ if(NOT return_value EQUAL 0)
|
|
|
+ message(CONFIGURE_LOG
|
|
|
+ "Unable to determine HDF5 ${language} flags from HDF5 wrapper.\n\n${output}")
|
|
|
+ if(NOT HDF5_FIND_QUIETLY)
|
|
|
+ message(STATUS
|
|
|
+ "Unable to determine HDF5 ${language} flags from HDF5 wrapper.")
|
|
|
+ endif()
|
|
|
endif()
|
|
|
execute_process(
|
|
|
COMMAND ${HDF5_${language}_COMPILER_EXECUTABLE} -showconfig
|
|
|
@@ -379,9 +387,13 @@ function( _HDF5_invoke_compiler language output_var return_value_var version_var
|
|
|
RESULT_VARIABLE return_value
|
|
|
OUTPUT_STRIP_TRAILING_WHITESPACE
|
|
|
)
|
|
|
- if(return_value AND NOT HDF5_FIND_QUIETLY)
|
|
|
- message(STATUS
|
|
|
- "Unable to determine HDF5 ${language} version_var from HDF5 wrapper.")
|
|
|
+ if(NOT return_value EQUAL 0)
|
|
|
+ message(CONFIGURE_LOG
|
|
|
+ "Unable to determine HDF5 ${language} version_var from HDF5 wrapper.\n\n${output}")
|
|
|
+ if(NOT HDF5_FIND_QUIETLY)
|
|
|
+ message(STATUS
|
|
|
+ "Unable to determine HDF5 ${language} version_var from HDF5 wrapper.")
|
|
|
+ endif()
|
|
|
endif()
|
|
|
string(REGEX MATCH "HDF5 Version: ([a-zA-Z0-9\\.\\-]*)" version "${config_output}")
|
|
|
if(version)
|
|
|
@@ -588,23 +600,23 @@ if(NOT HDF5_FOUND)
|
|
|
|
|
|
# First check to see if our regular compiler is one of wrappers
|
|
|
if(_lang STREQUAL "C")
|
|
|
- set(_HDF5_TEST_SRC ${_HDF5_TEST_DIR}/cmake_hdf5_test.c)
|
|
|
+ set(_HDF5_TEST_SRC cmake_hdf5_test.c)
|
|
|
if(CMAKE_CXX_COMPILER_LOADED AND NOT CMAKE_C_COMPILER_LOADED)
|
|
|
# CXX project without C enabled
|
|
|
- set(_HDF5_TEST_SRC ${_HDF5_TEST_DIR}/cmake_hdf5_test.cxx)
|
|
|
+ set(_HDF5_TEST_SRC cmake_hdf5_test.cxx)
|
|
|
endif()
|
|
|
_HDF5_test_regular_compiler_C(
|
|
|
HDF5_${_lang}_COMPILER_NO_INTERROGATE
|
|
|
HDF5_${_lang}_VERSION
|
|
|
HDF5_${_lang}_IS_PARALLEL)
|
|
|
elseif(_lang STREQUAL "CXX")
|
|
|
- set(_HDF5_TEST_SRC ${_HDF5_TEST_DIR}/cmake_hdf5_test.cxx)
|
|
|
+ set(_HDF5_TEST_SRC cmake_hdf5_test.cxx)
|
|
|
_HDF5_test_regular_compiler_CXX(
|
|
|
HDF5_${_lang}_COMPILER_NO_INTERROGATE
|
|
|
HDF5_${_lang}_VERSION
|
|
|
HDF5_${_lang}_IS_PARALLEL)
|
|
|
elseif(_lang STREQUAL "Fortran")
|
|
|
- set(_HDF5_TEST_SRC ${_HDF5_TEST_DIR}/cmake_hdf5_test.f90)
|
|
|
+ set(_HDF5_TEST_SRC cmake_hdf5_test.f90)
|
|
|
_HDF5_test_regular_compiler_Fortran(
|
|
|
HDF5_${_lang}_COMPILER_NO_INTERROGATE
|
|
|
HDF5_${_lang}_IS_PARALLEL)
|