From 9f2d3791c05f56362d368a695d58bec3c9a789c6 Mon Sep 17 00:00:00 2001 From: vsr Date: Mon, 15 Apr 2013 10:19:18 +0000 Subject: [PATCH] Fix build with CMake - process nesting variables substitutions properly --- salome_adm/cmake_files/deprecated/am2cmake.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/salome_adm/cmake_files/deprecated/am2cmake.py b/salome_adm/cmake_files/deprecated/am2cmake.py index 6d4bd1bf4..18e69841a 100644 --- a/salome_adm/cmake_files/deprecated/am2cmake.py +++ b/salome_adm/cmake_files/deprecated/am2cmake.py @@ -33,7 +33,7 @@ p_multiline = re.compile(r""" p_dollar = re.compile(r""" \$\( # a $ then a ( (?P # open the group val -[^)]* # the group contain 0 or more non ) characters +[^()]* # the group contain 0 or more non ) characters ) # close the group \) # a ) at the end """, re.VERBOSE) @@ -980,7 +980,13 @@ class CMakeFile(object): # Replace the $(TOTO) by ${TOTO} # Replace the @TOTO@ by ${TOTO} # -- - line = p_dollar.sub(r"${\1}", line) + # VSR 15.04.2013 - process nesting substitutions properly, e.g. $(aaa$(bbb)) + #line = p_dollar.sub(r"${\1}", line) + m_dollar = p_dollar.search(line) + while m_dollar: + line = p_dollar.sub(r"${\1}", line) + m_dollar = p_dollar.search(line) + pass line = p_arobas.sub(r"${\1}", line) # -- -- 2.39.2