1
0
mirror of https://github.com/Kitware/CMake.git synced 2025-10-14 02:08:27 +08:00

Replace string(REGEX REPLACE) with string(REPLACE) where possible

The simple replacement is much faster.
This commit is contained in:
Rolf Eike Beer
2014-04-06 21:51:33 +02:00
parent 2622bc3f65
commit 5bd48ac534
19 changed files with 32 additions and 34 deletions

View File

@@ -41,8 +41,7 @@ if (${depend_text} MATCHES ".+")
# message("FOUND DEPENDS")
# Remember, four backslashes is escaped to one backslash in the string.
string(REGEX REPLACE "\\\\ " " " depend_text ${depend_text})
string(REPLACE "\\ " " " depend_text ${depend_text})
# This works for the nvcc -M generated dependency files.
string(REGEX REPLACE "^.* : " "" depend_text ${depend_text})

View File

@@ -39,9 +39,8 @@ file(READ ${input_file} file_text)
if (${file_text} MATCHES ".+")
# Remember, four backslashes is escaped to one backslash in the string.
string(REGEX REPLACE ";" "\\\\;" file_text ${file_text})
string(REGEX REPLACE "\ncode" ";code" file_text ${file_text})
string(REPLACE ";" "\\;" file_text ${file_text})
string(REPLACE "\ncode" ";code" file_text ${file_text})
list(LENGTH file_text len)