From 5d80076aae0a23a5baa2ef344afc468ddf22aab9 Mon Sep 17 00:00:00 2001 From: adam Date: Thu, 8 Jan 2009 15:56:09 +0000 Subject: [PATCH] Fixes after merge from 4.1.4 Compatibility cmake 2.6 --- salome_adm/cmake_files/am2cmake.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/salome_adm/cmake_files/am2cmake.py b/salome_adm/cmake_files/am2cmake.py index e0c7d31db..0be73b5fb 100644 --- a/salome_adm/cmake_files/am2cmake.py +++ b/salome_adm/cmake_files/am2cmake.py @@ -53,7 +53,7 @@ p_if = re.compile(r""" if # an if \s+ # 1 or more space (?P # 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) -- 2.39.2