diff options
Diffstat (limited to 'config')
-rw-r--r-- | config/cmake/hdf5-config-version.cmake.in | 50 | ||||
-rw-r--r-- | config/cmake/hdf5-config.cmake.in | 26 | ||||
-rw-r--r-- | config/cmake/jrunTest.cmake | 8 | ||||
-rw-r--r-- | config/cmake/userblockTest.cmake | 8 | ||||
-rw-r--r-- | config/cmake_ext_mod/ConfigureChecks.cmake | 18 | ||||
-rw-r--r-- | config/cmake_ext_mod/HDFUseCXX.cmake | 4 | ||||
-rw-r--r-- | config/cmake_ext_mod/runTest.cmake | 8 |
7 files changed, 60 insertions, 62 deletions
diff --git a/config/cmake/hdf5-config-version.cmake.in b/config/cmake/hdf5-config-version.cmake.in index 8e16725..575c1ab 100644 --- a/config/cmake/hdf5-config-version.cmake.in +++ b/config/cmake/hdf5-config-version.cmake.in @@ -21,38 +21,38 @@ set (PACKAGE_VERSION "@HDF5_VERSION_STRING@") -if("${PACKAGE_VERSION}" VERSION_LESS "${PACKAGE_FIND_VERSION}" ) +if(PACKAGE_VERSION VERSION_LESS PACKAGE_FIND_VERSION) set(PACKAGE_VERSION_COMPATIBLE FALSE) -else () - if ("${PACKAGE_FIND_VERSION_MAJOR}" STREQUAL "@H5_VERS_MAJOR@") +else() + if("@H5_VERS_MAJOR@.@H5_VERS_MINOR@" MATCHES "^([0-9]+)\\.([0-9]+)") + set(CVF_VERSION_MAJOR "${CMAKE_MATCH_1}") + set(CVF_VERSION_MINOR "${CMAKE_MATCH_2}") + else() + set(CVF_VERSION_MAJOR "@HDF5_VERSION_STRING@") + set(CVF_VERSION_MINOR "") + endif() + + if((PACKAGE_FIND_VERSION_MAJOR STREQUAL CVF_VERSION_MAJOR) AND + (PACKAGE_FIND_VERSION_MINOR STREQUAL CVF_VERSION_MINOR)) + set(PACKAGE_VERSION_COMPATIBLE TRUE) + else() + set(PACKAGE_VERSION_COMPATIBLE FALSE) + endif() + + if(PACKAGE_FIND_VERSION STREQUAL PACKAGE_VERSION) + set(PACKAGE_VERSION_EXACT TRUE) + endif() +endif() - # exact match for version @H5_VERS_MAJOR@.@H5_VERS_MINOR@ - if ("${PACKAGE_FIND_VERSION_MINOR}" STREQUAL "@H5_VERS_MINOR@") - - # compatible with any version @H5_VERS_MAJOR@.@H5_VERS_MINOR@.x - set (PACKAGE_VERSION_COMPATIBLE TRUE) - - if ("${PACKAGE_FIND_VERSION_PATCH}" STREQUAL "@H5_VERS_RELEASE@") - set (PACKAGE_VERSION_EXACT TRUE) - - if ("${PACKAGE_FIND_VERSION_TWEAK}" STREQUAL "@H5_VERS_SUBRELEASE@") - # not using this yet - endif () - endif () - else () - set (PACKAGE_VERSION_COMPATIBLE FALSE) - endif () - endif () -endif () # if the installed or the using project don't have CMAKE_SIZEOF_VOID_P set, ignore it: -if("${CMAKE_SIZEOF_VOID_P}" STREQUAL "" OR "@CMAKE_SIZEOF_VOID_P@" STREQUAL "") +if("${CMAKE_SIZEOF_VOID_P}" STREQUAL "" OR "@CMAKE_SIZEOF_VOID_P@" STREQUAL "") return() -endif () +endif() # check that the installed version has the same 32/64bit-ness as the one which is currently searching: -if(NOT "${CMAKE_SIZEOF_VOID_P}" STREQUAL "@CMAKE_SIZEOF_VOID_P@") +if(NOT CMAKE_SIZEOF_VOID_P STREQUAL "@CMAKE_SIZEOF_VOID_P@") math(EXPR installedBits "@CMAKE_SIZEOF_VOID_P@ * 8") set(PACKAGE_VERSION "${PACKAGE_VERSION} (${installedBits}bit)") set(PACKAGE_VERSION_UNSUITABLE TRUE) -endif () +endif() diff --git a/config/cmake/hdf5-config.cmake.in b/config/cmake/hdf5-config.cmake.in index 3bd9e1d..b1ef0ac 100644 --- a/config/cmake/hdf5-config.cmake.in +++ b/config/cmake/hdf5-config.cmake.in @@ -127,14 +127,14 @@ endif () # Handle requested components: list (REMOVE_DUPLICATES ${HDF5_PACKAGE_NAME}_FIND_COMPONENTS) foreach (comp IN LISTS ${HDF5_PACKAGE_NAME}_FIND_COMPONENTS) - if (${comp} STREQUAL "shared") + if (comp STREQUAL "shared") list (REMOVE_ITEM ${HDF5_PACKAGE_NAME}_FIND_COMPONENTS ${comp}) set (${HDF5_PACKAGE_NAME}_LIB_TYPE ${${HDF5_PACKAGE_NAME}_LIB_TYPE} ${comp}) if (${HDF5_PACKAGE_NAME}_BUILD_FORTRAN) set (${HDF5_PACKAGE_NAME}_INCLUDE_DIR_FORTRAN "@PACKAGE_INCLUDE_INSTALL_DIR@/shared") endif () - elseif (${comp} STREQUAL "static") + elseif (comp STREQUAL "static") list (REMOVE_ITEM ${HDF5_PACKAGE_NAME}_FIND_COMPONENTS ${comp}) set (${HDF5_PACKAGE_NAME}_LIB_TYPE ${${HDF5_PACKAGE_NAME}_LIB_TYPE} ${comp}) @@ -146,32 +146,32 @@ endforeach () foreach (libtype IN LISTS ${HDF5_PACKAGE_NAME}_LIB_TYPE) foreach (comp IN LISTS ${HDF5_PACKAGE_NAME}_FIND_COMPONENTS) set (hdf5_comp2) - if (${comp} STREQUAL "C") + if (comp STREQUAL "C") set (hdf5_comp "hdf5") - elseif (${comp} STREQUAL "CXX") + elseif (comp STREQUAL "CXX") set (hdf5_comp "hdf5_cpp") - elseif (${comp} STREQUAL "HL") + elseif (comp STREQUAL "HL") set (hdf5_comp "hdf5_hl") - elseif (${comp} STREQUAL "CXX_HL") + elseif (comp STREQUAL "CXX_HL") set (hdf5_comp "hdf5_hl_cpp") - elseif (${comp} STREQUAL "Java") + elseif (comp STREQUAL "Java") set (hdf5_comp "hdf5_java") - elseif (${comp} STREQUAL "Tools") + elseif (comp STREQUAL "Tools") set (hdf5_comp "hdf5_tools") - elseif (${comp} STREQUAL "Fortran") + elseif (comp STREQUAL "Fortran") set (hdf5_comp2 "hdf5_f90cstub") set (hdf5_comp "hdf5_fortran") - elseif (${comp} STREQUAL "Fortran_HL") + elseif (comp STREQUAL "Fortran_HL") set (hdf5_comp2 "hdf5_hl_f90cstub") set (hdf5_comp "hdf5_hl_fortran") endif () - if (${comp} STREQUAL "Java") + if (comp STREQUAL "Java") list (FIND ${HDF5_PACKAGE_NAME}_EXPORT_LIBRARIES "${hdf5_comp}" HAVE_COMP) else () list (FIND ${HDF5_PACKAGE_NAME}_EXPORT_LIBRARIES "${hdf5_comp}-${libtype}" HAVE_COMP) endif () if (${HAVE_COMP} LESS 0) - if (${comp} STREQUAL "Java") + if (comp STREQUAL "Java") set (${HDF5_PACKAGE_NAME}_${comp}_FOUND 0) else () set (${HDF5_PACKAGE_NAME}_${libtype}_${comp}_FOUND 0) @@ -186,7 +186,7 @@ foreach (libtype IN LISTS ${HDF5_PACKAGE_NAME}_LIB_TYPE) string(TOUPPER ${HDF5_PACKAGE_NAME}_${comp}_${libtype}_LIBRARY COMP_LIBRARY) set (${COMP_LIBRARY} ${${COMP_LIBRARY}} @HDF5_PACKAGE@::${hdf5_comp2}-${libtype} @HDF5_PACKAGE@::${hdf5_comp}-${libtype}) endif () - elseif (${comp} STREQUAL "Java") + elseif (comp STREQUAL "Java") set (${HDF5_PACKAGE_NAME}_${comp}_FOUND 1) string(TOUPPER ${HDF5_PACKAGE_NAME}_${comp}_LIBRARY COMP_LIBRARY) set (${COMP_LIBRARY} ${${COMP_LIBRARY}} hdf5::${hdf5_comp}) diff --git a/config/cmake/jrunTest.cmake b/config/cmake/jrunTest.cmake index 23f297c..d5cd903 100644 --- a/config/cmake/jrunTest.cmake +++ b/config/cmake/jrunTest.cmake @@ -142,8 +142,8 @@ if (NOT TEST_SKIP_COMPARE) foreach (line RANGE 0 ${_FP_LEN}) list (GET test_act ${line} str_act) list (GET test_ref ${line} str_ref) - if (NOT ${str_act} STREQUAL ${str_ref}) - if (NOT str_act STREQUAL "") + if (NOT str_act STREQUAL str_ref) + if (str_act) set (TEST_RESULT 1) message ("line = ${line}\n***ACTUAL: ${str_act}\n****REFER: ${str_ref}\n") endif () @@ -194,8 +194,8 @@ if (NOT TEST_SKIP_COMPARE) foreach (line RANGE 0 ${_FP_LEN}) list (GET test_act ${line} str_act) list (GET test_ref ${line} str_ref) - if (NOT ${str_act} STREQUAL ${str_ref}) - if (NOT ${str_act} STREQUAL "") + if (NOT str_act STREQUAL str_ref) + if (str_act) set (TEST_RESULT 1) message ("line = ${line}\n***ACTUAL: ${str_act}\n****REFER: ${str_ref}\n") endif () diff --git a/config/cmake/userblockTest.cmake b/config/cmake/userblockTest.cmake index 9af7e5b..4a580d0 100644 --- a/config/cmake/userblockTest.cmake +++ b/config/cmake/userblockTest.cmake @@ -62,7 +62,7 @@ if (TEST_CHECKUB STREQUAL "YES") OUTPUT_VARIABLE TEST_OUT ERROR_VARIABLE TEST_ERROR ) - if (NOT ${TEST_RESULT} STREQUAL "0") + if (TEST_RESULT) message (FATAL_ERROR "Failed: The output of ${TEST_PROGRAM} ${TEST_OFILE} is: ${TEST_ERROR}") endif () file (READ ${TEST_HFILE}.len.txt TEST_O_STRING_LEN) @@ -70,7 +70,7 @@ if (TEST_CHECKUB STREQUAL "YES") math( EXPR TEST_STRING_SIZE "${TEST_U_STRING_LEN} + ${TEST_O_STRING_LEN}" ) - if (NOT TEST_O_STRING_LEN STREQUAL "0") + if (TEST_O_STRING_LEN) #$JAM_BIN/getub -c $s2 $origfile > $cmpfile EXECUTE_PROCESS ( COMMAND ${TEST_GET_PROGRAM} -c ${TEST_O_STRING_LEN} ${TEST_OFILE} @@ -108,7 +108,7 @@ if (TEST_CHECKUB STREQUAL "YES") message (STATUS "COMPARE Result: ${TEST_RESULT}: ${TEST_STRING_SIZE}=${TEST_U_STRING_LEN}+${TEST_O_STRING_LEN}") # if the return value is !=${TEST_EXPECT} bail out - if (NOT ${TEST_RESULT} STREQUAL ${TEST_EXPECT}) + if (NOT TEST_RESULT EQUAL TEST_EXPECT) message (FATAL_ERROR "Failed: The output of ${TEST_HFILE}-ub did not match ${TEST_HFILE}.\n${TEST_ERROR}") endif () else () @@ -121,7 +121,7 @@ else () OUTPUT_VARIABLE TEST_OUT ERROR_VARIABLE TEST_ERROR ) - if (NOT TEST_H_STRING_LEN STREQUAL "0") + if (TEST_H_STRING_LEN) message (FATAL_ERROR "Failed: The output of ${TEST_HFILE} was NOT empty") endif () endif () diff --git a/config/cmake_ext_mod/ConfigureChecks.cmake b/config/cmake_ext_mod/ConfigureChecks.cmake index 986280f..cc9de79 100644 --- a/config/cmake_ext_mod/ConfigureChecks.cmake +++ b/config/cmake_ext_mod/ConfigureChecks.cmake @@ -229,7 +229,7 @@ macro (HDF_FUNCTION_TEST OTHER_TEST) endif () #message (STATUS "Performing ${OTHER_TEST}") - TRY_COMPILE (${OTHER_TEST} + try_compile (${OTHER_TEST} ${CMAKE_BINARY_DIR} ${HDF_RESOURCES_EXT_DIR}/HDFTests.c COMPILE_DEFINITIONS "${MACRO_CHECK_FUNCTION_DEFINITIONS}" @@ -274,12 +274,10 @@ if (NOT WINDOWS) # functionality so clock_gettime and CLOCK_MONOTONIC are defined # correctly. This was later updated to 200112L so that # posix_memalign() is visible for the direct VFD code on Linux - # systems. Even later, this was changed to 200809L to support - # pread/pwrite in VFDs. - # + # systems. # POSIX feature information can be found in the gcc manual at: # http://www.gnu.org/s/libc/manual/html_node/Feature-Test-Macros.html - set (HDF_EXTRA_C_FLAGS -D_POSIX_C_SOURCE=200809L) + set (HDF_EXTRA_C_FLAGS -D_POSIX_C_SOURCE=200112L) # Need to add this so that O_DIRECT is visible for the direct # VFD on Linux systems. @@ -288,7 +286,7 @@ if (NOT WINDOWS) option (HDF_ENABLE_LARGE_FILE "Enable support for large (64-bit) files on Linux." ON) if (HDF_ENABLE_LARGE_FILE AND NOT DEFINED TEST_LFS_WORKS_RUN) set (msg "Performing TEST_LFS_WORKS") - TRY_RUN (TEST_LFS_WORKS_RUN TEST_LFS_WORKS_COMPILE + try_run (TEST_LFS_WORKS_RUN TEST_LFS_WORKS_COMPILE ${CMAKE_BINARY_DIR} ${HDF_RESOURCES_EXT_DIR}/HDFTests.c COMPILE_DEFINITIONS "-DTEST_LFS_WORKS" @@ -445,7 +443,7 @@ if (NOT WINDOWS) # Check a bunch of time functions #----------------------------------------------------------------------------- CHECK_FUNCTION_EXISTS (gettimeofday ${HDF_PREFIX}_HAVE_GETTIMEOFDAY) - foreach (test + foreach (time_test HAVE_TM_GMTOFF HAVE___TM_GMTOFF # HAVE_TIMEZONE @@ -455,7 +453,7 @@ if (NOT WINDOWS) HAVE_TM_ZONE HAVE_STRUCT_TM_TM_ZONE ) - HDF_FUNCTION_TEST (${test}) + HDF_FUNCTION_TEST (${time_test}) endforeach () if (NOT CYGWIN AND NOT MINGW) HDF_FUNCTION_TEST (HAVE_TIMEZONE) @@ -559,7 +557,7 @@ endif () # Check a bunch of other functions #----------------------------------------------------------------------------- if (NOT WINDOWS) - foreach (test + foreach (other_test HAVE_ATTRIBUTE HAVE_C99_FUNC # STDC_HEADERS @@ -568,7 +566,7 @@ if (NOT WINDOWS) SYSTEM_SCOPE_THREADS HAVE_SOCKLEN_T ) - HDF_FUNCTION_TEST (${test}) + HDF_FUNCTION_TEST (${other_test}) endforeach () endif () diff --git a/config/cmake_ext_mod/HDFUseCXX.cmake b/config/cmake_ext_mod/HDFUseCXX.cmake index efaa556..8d98147 100644 --- a/config/cmake_ext_mod/HDFUseCXX.cmake +++ b/config/cmake_ext_mod/HDFUseCXX.cmake @@ -96,7 +96,7 @@ endmacro () # Check a bunch of cxx functions #----------------------------------------------------------------------------- if (CMAKE_CXX_COMPILER_LOADED) - foreach (test + foreach (cxx_test OLD_HEADER_FILENAME HDF_NO_NAMESPACE HDF_NO_STD @@ -104,6 +104,6 @@ if (CMAKE_CXX_COMPILER_LOADED) NO_STATIC_CAST CXX_HAVE_OFFSETOF ) - HDF_CXX_FUNCTION_TEST (${test}) + HDF_CXX_FUNCTION_TEST (${cxx_test}) endforeach () endif () diff --git a/config/cmake_ext_mod/runTest.cmake b/config/cmake_ext_mod/runTest.cmake index 48402a2..13e8a4d 100644 --- a/config/cmake_ext_mod/runTest.cmake +++ b/config/cmake_ext_mod/runTest.cmake @@ -218,8 +218,8 @@ if (NOT TEST_SKIP_COMPARE) foreach (line RANGE 0 ${_FP_LEN}) list (GET test_act ${line} str_act) list (GET test_ref ${line} str_ref) - if (NOT ${str_act} STREQUAL ${str_ref}) - if (NOT str_act STREQUAL "") + if (NOT str_act STREQUAL str_ref) + if (str_act) set (TEST_RESULT 1) message ("line = ${line}\n***ACTUAL: ${str_act}\n****REFER: ${str_ref}\n") endif () @@ -270,8 +270,8 @@ if (NOT TEST_SKIP_COMPARE) foreach (line RANGE 0 ${_FP_LEN}) list (GET test_act ${line} str_act) list (GET test_ref ${line} str_ref) - if (NOT ${str_act} STREQUAL ${str_ref}) - if (NOT ${str_act} STREQUAL "") + if (NOT str_act STREQUAL str_ref) + if (str_act) set (TEST_RESULT 1) message ("line = ${line}\n***ACTUAL: ${str_act}\n****REFER: ${str_ref}\n") endif () |