diff options
author | Ben Boeckel <mathstuf@users.noreply.github.com> | 2021-08-23 13:36:21 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-08-23 13:36:21 (GMT) |
commit | b5f5c59f297be19096051282068cdcc14275eb34 (patch) | |
tree | 2a2ec7045054aaec6650328f635e4c04cf80999e /config | |
parent | b38bc071e956bec607b180a7d3f8217197393f02 (diff) | |
download | hdf5-b5f5c59f297be19096051282068cdcc14275eb34.zip hdf5-b5f5c59f297be19096051282068cdcc14275eb34.tar.gz hdf5-b5f5c59f297be19096051282068cdcc14275eb34.tar.bz2 |
cmake: simplify try_run result comparisons (#950)
Instead of looking at `MATCHES 0` which runs a regex and returns a false
positive for any result such as `10`, check if they are equal to `0`.
Also quote `0` to avoid looking it up as a variable (which was left
behind prior to the fix to use `${RETURN_VAR}` in the `c_run` macro).
Diffstat (limited to 'config')
-rw-r--r-- | config/cmake/ConfigureChecks.cmake | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/config/cmake/ConfigureChecks.cmake b/config/cmake/ConfigureChecks.cmake index 4db3ad4..263cedf 100644 --- a/config/cmake/ConfigureChecks.cmake +++ b/config/cmake/ConfigureChecks.cmake @@ -149,7 +149,7 @@ if (NOT WINDOWS) OUTPUT_VARIABLE OUTPUT ) if (TEST_DIRECT_VFD_WORKS_COMPILE) - if (TEST_DIRECT_VFD_WORKS_RUN MATCHES 0) + if (TEST_DIRECT_VFD_WORKS_RUN EQUAL "0") HDF_FUNCTION_TEST (HAVE_DIRECT) set (CMAKE_REQUIRED_DEFINITIONS "${CMAKE_REQUIRED_DEFINITIONS} -D_GNU_SOURCE") add_definitions ("-D_GNU_SOURCE") @@ -259,8 +259,8 @@ macro (C_RUN FUNCTION_NAME SOURCE_CODE RETURN_VAR) message (VERBOSE "* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ") endif () - if (${COMPILE_RESULT_VAR}) - if (${RUN_RESULT_VAR} MATCHES 0) + if (COMPILE_RESULT_VAR) + if (RUN_RESULT_VAR EQUAL "0") set (${RETURN_VAR} 1 CACHE INTERNAL "Have C function ${FUNCTION_NAME}") if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0") message (VERBOSE "Testing C ${FUNCTION_NAME} - OK") @@ -318,7 +318,7 @@ message (STATUS "Testing maximum decimal precision for C - ${PROG_OUTPUT4}") list (GET PROG_OUTPUT4 0 H5_LDBL_DIG) list (GET PROG_OUTPUT4 1 H5_FLT128_DIG) -if (${HDF_PREFIX}_SIZEOF___FLOAT128 EQUAL 0 OR FLT128_DIG EQUAL 0) +if (${HDF_PREFIX}_SIZEOF___FLOAT128 EQUAL "0" OR FLT128_DIG EQUAL "0") set (${HDF_PREFIX}_HAVE_FLOAT128 0) set (${HDF_PREFIX}_SIZEOF___FLOAT128 0) set (_PAC_C_MAX_REAL_PRECISION ${H5_LDBL_DIG}) @@ -344,7 +344,7 @@ macro (H5ConversionTests TEST msg) OUTPUT_VARIABLE OUTPUT ) if (${TEST}_COMPILE) - if (${TEST}_RUN MATCHES 0) + if (${TEST}_RUN EQUAL "0") set (${TEST} 1 CACHE INTERNAL ${msg}) if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0") message (VERBOSE "${msg}... yes") |