Fix usage of string (FIND ...) command in CMake files (#5470)

This commit is contained in:
jhendersonHDF
2025-04-23 07:25:03 -05:00
committed by GitHub
parent da7c08c296
commit 4a0c3b440b
6 changed files with 13 additions and 13 deletions
+1 -1
View File
@@ -117,7 +117,7 @@ if (HDF5_VOL_ALLOW_EXTERNAL MATCHES "GIT" OR HDF5_VOL_ALLOW_EXTERNAL MATCHES "LO
endif()
# Extract the name of the VOL connector
string (FIND HDF5_VOL_SOURCE "/" hdf5_vol_name_pos REVERSE)
string (FIND "${HDF5_VOL_SOURCE}" "/" hdf5_vol_name_pos REVERSE)
if (hdf5_vol_name_pos EQUAL -1)
if (HDF5_VOL_ALLOW_EXTERNAL MATCHES "GIT")
message (SEND_ERROR "Invalid URL '${HDF5_VOL_SOURCE}' specified for HDF5_VOL_URL${vol_idx_fixed}")
+2 -2
View File
@@ -73,12 +73,12 @@ message (STATUS "COMMAND Error: ${TEST_ERROR}")
# remove special output
if (EXISTS "${TEST_FOLDER}/${TEST_OUTPUT}")
file (READ ${TEST_FOLDER}/${TEST_OUTPUT} TEST_STREAM)
string (FIND TEST_STREAM "_pmi_alps" TEST_FIND_RESULT)
string (FIND "${TEST_STREAM}" "_pmi_alps" TEST_FIND_RESULT)
if (TEST_FIND_RESULT GREATER -1)
string (REGEX REPLACE "^.*_pmi_alps[^\n]+\n" "" TEST_STREAM "${TEST_STREAM}")
file (WRITE ${TEST_FOLDER}/${TEST_OUTPUT} ${TEST_STREAM})
endif ()
string (FIND TEST_STREAM "ulimit -s" TEST_FIND_RESULT)
string (FIND "${TEST_STREAM}" "ulimit -s" TEST_FIND_RESULT)
if (TEST_FIND_RESULT GREATER -1)
string (REGEX REPLACE "^.*ulimit -s[^\n]+\n" "" TEST_STREAM "${TEST_STREAM}")
file (WRITE ${TEST_FOLDER}/${TEST_OUTPUT} ${TEST_STREAM})
+3 -3
View File
@@ -139,12 +139,12 @@ message (STATUS "COMMAND Error: ${TEST_ERROR}")
# remove special output
if (EXISTS "${TEST_FOLDER}/${TEST_OUTPUT}")
file (READ ${TEST_FOLDER}/${TEST_OUTPUT} TEST_STREAM)
string (FIND TEST_STREAM "_pmi_alps" TEST_FIND_RESULT)
string (FIND "${TEST_STREAM}" "_pmi_alps" TEST_FIND_RESULT)
if (TEST_FIND_RESULT GREATER -1)
string (REGEX REPLACE "^.*_pmi_alps[^\n]+\n" "" TEST_STREAM "${TEST_STREAM}")
file (WRITE ${TEST_FOLDER}/${TEST_OUTPUT} ${TEST_STREAM})
endif ()
string (FIND TEST_STREAM "ulimit -s" TEST_FIND_RESULT)
string (FIND "${TEST_STREAM}" "ulimit -s" TEST_FIND_RESULT)
if (TEST_FIND_RESULT GREATER -1)
string (REGEX REPLACE "^.*ulimit -s[^\n]+\n" "" TEST_STREAM "${TEST_STREAM}")
file (WRITE ${TEST_FOLDER}/${TEST_OUTPUT} ${TEST_STREAM})
@@ -163,7 +163,7 @@ else ()
file (READ ${TEST_FOLDER}/${TEST_OUTPUT}.err TEST_STREAM)
endif ()
endif ()
string (FIND TEST_STREAM "no version information available" TEST_FIND_RESULT)
string (FIND "${TEST_STREAM}" "no version information available" TEST_FIND_RESULT)
if (TEST_FIND_RESULT GREATER -1)
string (REGEX REPLACE "^.*no version information available[^\n]+\n" "" TEST_STREAM "${TEST_STREAM}")
# write back the changes to the original files
+1 -1
View File
@@ -428,7 +428,7 @@ string (REGEX REPLACE "}" "" OUT_VAR2 ${OUT_VAR2})
set (${HDF_PREFIX}_H5CONFIG_F_RKIND_SIZEOF "INTEGER, DIMENSION(1:num_rkinds) :: rkind_sizeof = (/${OUT_VAR2}/)")
# Setting definition if there is a 16 byte fortran integer
string (FIND PAC_FC_ALL_INTEGER_KINDS_SIZEOF "16" pos)
string (FIND "${PAC_FC_ALL_INTEGER_KINDS_SIZEOF}" "16" pos)
if (${pos} EQUAL -1)
set (${HDF_PREFIX}_HAVE_Fortran_INTEGER_SIZEOF_16 0)
else ()
+2 -2
View File
@@ -78,12 +78,12 @@ message (STATUS "COMMAND Error: ${TEST_ERROR}")
# remove special regex text from the output
if (EXISTS "${TEST_FOLDER}/${TEST_OUTPUT}")
file (READ ${TEST_FOLDER}/${TEST_OUTPUT} TEST_STREAM)
string (FIND TEST_STREAM "_pmi_alps" TEST_FIND_RESULT)
string (FIND "${TEST_STREAM}" "_pmi_alps" TEST_FIND_RESULT)
if (TEST_FIND_RESULT GREATER -1)
string (REGEX REPLACE "^.*_pmi_alps[^\n]+\n" "" TEST_STREAM "${TEST_STREAM}")
file (WRITE ${TEST_FOLDER}/${TEST_OUTPUT} ${TEST_STREAM})
endif ()
string (FIND TEST_STREAM "ulimit -s" TEST_FIND_RESULT)
string (FIND "${TEST_STREAM}" "ulimit -s" TEST_FIND_RESULT)
if (TEST_FIND_RESULT GREATER -1)
string (REGEX REPLACE "^.*ulimit -s[^\n]+\n" "" TEST_STREAM "${TEST_STREAM}")
file (WRITE ${TEST_FOLDER}/${TEST_OUTPUT} ${TEST_STREAM})
+4 -4
View File
@@ -114,7 +114,7 @@ if (EXISTS "${TEST_FOLDER}/${TEST_OUTPUT}.err")
endif ()
# remove special output
string (REGEX REPLACE "^.*_pmi_alps[^\n]+\n" "" TEST_STREAM "${TEST_STREAM}")
string (FIND TEST_STREAM "no version information available" TEST_FIND_RESULT)
string (FIND "${TEST_STREAM}" "no version information available" TEST_FIND_RESULT)
if (TEST_FIND_RESULT GREATER -1)
string (REGEX REPLACE "^.*no version information available[^\n]+\n" "" TEST_STREAM "${TEST_STREAM}")
# write back the changes to the original files
@@ -149,17 +149,17 @@ endif ()
# remove special regex text from the output
if (EXISTS "${TEST_FOLDER}/${TEST_OUTPUT}")
file (READ ${TEST_FOLDER}/${TEST_OUTPUT} TEST_STREAM)
string (FIND TEST_STREAM "_pmi_alps" TEST_FIND_RESULT)
string (FIND "${TEST_STREAM}" "_pmi_alps" TEST_FIND_RESULT)
if (TEST_FIND_RESULT GREATER -1)
string (REGEX REPLACE "^.*_pmi_alps[^\n]+\n" "" TEST_STREAM "${TEST_STREAM}")
file (WRITE ${TEST_FOLDER}/${TEST_OUTPUT} ${TEST_STREAM})
endif ()
string (FIND TEST_STREAM "ulimit -s" TEST_FIND_RESULT)
string (FIND "${TEST_STREAM}" "ulimit -s" TEST_FIND_RESULT)
if (TEST_FIND_RESULT GREATER -1)
string (REGEX REPLACE "^.*ulimit -s[^\n]+\n" "" TEST_STREAM "${TEST_STREAM}")
file (WRITE ${TEST_FOLDER}/${TEST_OUTPUT} ${TEST_STREAM})
endif ()
string (FIND TEST_STREAM "no version information available" TEST_FIND_RESULT)
string (FIND "${TEST_STREAM}" "no version information available" TEST_FIND_RESULT)
if (TEST_FIND_RESULT GREATER -1)
string (REGEX REPLACE "^.*no version information available[^\n]+\n" "" TEST_STREAM "${TEST_STREAM}")
file (WRITE ${TEST_FOLDER}/${TEST_OUTPUT} "${TEST_STREAM}")