From: ageay Date: Fri, 16 Mar 2012 16:04:42 +0000 (+0000) Subject: am2cmake.py does not overwrite not automatically generated CMakeLists.txt. X-Git-Tag: V6_5_0a1~29 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=97e950b74c151897b18949d489eff6a3ad8246a4;p=modules%2Fkernel.git am2cmake.py does not overwrite not automatically generated CMakeLists.txt. --- diff --git a/salome_adm/cmake_files/am2cmake.py b/salome_adm/cmake_files/am2cmake.py index d0191b8e6..e7f0e2dad 100644 --- a/salome_adm/cmake_files/am2cmake.py +++ b/salome_adm/cmake_files/am2cmake.py @@ -454,7 +454,10 @@ class CMakeFile(object): content = '\n'.join(lines) # -- - self.content = content + self.content = "# ---------------------------------------------------------------------\n" + self.content += "# This file was automatically generated by am2cmake (erwan.adam@cea.fr)\n" + self.content += "# ---------------------------------------------------------------------\n" + self.content += content # -- return @@ -2549,8 +2552,22 @@ if __name__ == "__main__": # -- for f in files: if f in ["Makefile.am", "Makefile.am.cmake"]: - convertAmFile(the_root, root, dirs, files, f, module) - nok += 1 + convert = True + if "CMakeLists.txt" in files: + from os.path import join + ff = open(join(root, "CMakeLists.txt")) + content = ff.read() + import sys + sys.exit(-1) + ff.close() + if content.find("generated by am2cmake") == -1: + convert = False + pass + pass + if convert: + convertAmFile(the_root, root, dirs, files, f, module) + nok += 1 + pass pass pass pass