]> SALOME platform Git repositories - modules/kernel.git/commitdiff
Salome HOME
Fixes after merge from 4.1.4
authoradam <adam>
Thu, 8 Jan 2009 15:56:09 +0000 (15:56 +0000)
committeradam <adam>
Thu, 8 Jan 2009 15:56:09 +0000 (15:56 +0000)
Compatibility cmake 2.6

salome_adm/cmake_files/am2cmake.py

index e0c7d31dbf4202170b701995b29d3a3dc4d7e7cd..0be73b5fb518be48ead40f506883ec75dae95a41 100644 (file)
@@ -53,7 +53,7 @@ p_if = re.compile(r"""
 if         # an if
 \s+        # 1 or more space
 (?P<val>   # open the group val
-\w+        # the group contain 1 or more alphanumeric characters 
+[^\s]+     # the group contain 1 or more non space characters
 )          # close the group
 """, re.VERBOSE)
 
@@ -227,6 +227,13 @@ class CMakeFile(object):
     
     def initialize(self, newlines):
         if self.root == self.the_root:
+            # --
+            newlines.append("""
+            CMAKE_MINIMUM_REQUIRED(VERSION 2.4)
+            IF(COMMAND cmake_policy)
+            cmake_policy(SET CMP0003 NEW)
+            ENDIF(COMMAND cmake_policy)
+            """)
             # --
             if self.module == "kernel":
                 newlines.append("""
@@ -381,6 +388,9 @@ class CMakeFile(object):
         match = p_if.match(line)
         if match:
             theif = match.group("val")
+            if theif[0] == "!":
+                theif = "NOT " + theif[1:]
+                pass
             line = p_if.sub(r"IF(%s)"%(theif), line)
             opened_ifs.append(theif)
             newlines.append(line)