]> SALOME platform Git repositories - modules/kernel.git/commitdiff
Salome HOME
am2cmake.py does not overwrite not automatically generated CMakeLists.txt.
authorageay <ageay>
Fri, 16 Mar 2012 16:04:42 +0000 (16:04 +0000)
committerageay <ageay>
Fri, 16 Mar 2012 16:04:42 +0000 (16:04 +0000)
salome_adm/cmake_files/am2cmake.py

index d0191b8e6f27a3374bb3456300e7db676f036fc4..e7f0e2dade38cea92947cbe42f638a22b90133c7 100644 (file)
@@ -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