From 97e950b74c151897b18949d489eff6a3ad8246a4 Mon Sep 17 00:00:00 2001 From: ageay Date: Fri, 16 Mar 2012 16:04:42 +0000 Subject: [PATCH] am2cmake.py does not overwrite not automatically generated CMakeLists.txt. --- salome_adm/cmake_files/am2cmake.py | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) 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 -- 2.39.2