mirror of
https://github.com/HDFGroup/hdf5.git
synced 2026-09-25 04:09:44 +03:00
Fix usage of string (FIND ...) command in CMake files (#5470)
This commit is contained in:
+1
-1
@@ -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}")
|
||||
|
||||
@@ -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})
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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 ()
|
||||
|
||||
@@ -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})
|
||||
|
||||
@@ -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}")
|
||||
|
||||
Reference in New Issue
Block a user