summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRyan Volz <rvolz@mit.edu>2019-07-05 17:25:41 -0400
committerMartin Braun <martin.braun@ettus.com>2020-01-02 15:00:10 -0800
commit3e988eeadd61950546bdd765f2296b20aaf06648 (patch)
treea9319f39c2fcc3c4f0f841c06fa0a0141534b952
parentbe17636f705670f906f2ffd58e69d71de36036e5 (diff)
Use raw strings for paths substituted directly into python strings.
-rw-r--r--cmake/Modules/GrPython.cmake4
1 files changed, 2 insertions, 2 deletions
diff --git a/cmake/Modules/GrPython.cmake b/cmake/Modules/GrPython.cmake
index fd9b7583a4..b7f72e666e 100644
--- a/cmake/Modules/GrPython.cmake
+++ b/cmake/Modules/GrPython.cmake
@@ -137,7 +137,7 @@ function(GR_UNIQUE_TARGET desc)
file(RELATIVE_PATH reldir ${CMAKE_BINARY_DIR} ${CMAKE_CURRENT_BINARY_DIR})
execute_process(COMMAND ${PYTHON_EXECUTABLE} -c "import re, hashlib
unique = hashlib.md5(b'${reldir}${ARGN}').hexdigest()[:5]
-print(re.sub('\\W', '_', '${desc} ${reldir} ' + unique))"
+print(re.sub('\\W', '_', r'${desc} ${reldir} ' + unique))"
OUTPUT_VARIABLE _target OUTPUT_STRIP_TRAILING_WHITESPACE)
add_custom_target(${_target} ALL DEPENDS ${ARGN})
endfunction(GR_UNIQUE_TARGET)
@@ -308,7 +308,7 @@ function(GR_PYTHON_INSTALL)
add_custom_command(
OUTPUT ${pyexefile} DEPENDS ${pyfile}
COMMAND ${PYTHON_EXECUTABLE} -c
- "import re; R=re.compile('^\#!.*$\\n',flags=re.MULTILINE); open('${pyexefile}','w').write('\#!${pyexe_native}\\n'+R.sub('',open('${pyfile}','r').read()))"
+ "import re; R=re.compile('^\#!.*$\\n',flags=re.MULTILINE); open(r'${pyexefile}','w').write(r'\#!${pyexe_native}'+'\\n'+R.sub('',open(r'${pyfile}','r').read()))"
COMMENT "Shebangin ${pyfile_name}"
VERBATIM
)