Salome HOME
Compilation SALOME on Windows
[modules/kernel.git] / salome_adm / cmake_files / deprecated / am2cmake.py
index fb93c53922773edd33d50b45bc3b5829220c8d0d..dcc4a7411d3d2cb53781a7d5e1e59e2b20ce981e 100644 (file)
@@ -33,7 +33,7 @@ p_multiline = re.compile(r"""
 p_dollar = re.compile(r"""
 \$\(           # a $ then a (
 (?P<val>       # open the group val
-[^)]*          # the group contain 0 or more non ) characters
+[^()]*         # the group contain 0 or more non ) characters
 )              # close the group
 \)             # a ) at the end
 """, re.VERBOSE)
@@ -550,6 +550,7 @@ class CMakeFile(object):
                         INCLUDE(${KERNEL_ROOT_DIR}/salome_adm/cmake_files/deprecated/FindSWIG.cmake)
                         INCLUDE(${KERNEL_ROOT_DIR}/salome_adm/cmake_files/FindCPPUNIT.cmake)
                         INCLUDE(${KERNEL_ROOT_DIR}/salome_adm/cmake_files/deprecated/FindDOXYGEN.cmake)
+                        INCLUDE(${KERNEL_ROOT_DIR}/salome_adm/cmake_files/SalomeMacros.cmake)
                         INCLUDE(${KERNEL_ROOT_DIR}/salome_adm/cmake_files/FindSalomeLIBBATCH.cmake)
                         INCLUDE(${KERNEL_ROOT_DIR}/salome_adm/cmake_files/deprecated/FindKERNEL.cmake)
                         """)
@@ -594,9 +595,11 @@ class CMakeFile(object):
                             newlines.append("""
                             SET(GEOM_ROOT_DIR $ENV{GEOM_ROOT_DIR})
                             SET(MED_ROOT_DIR $ENV{MED_ROOT_DIR})
+                            INCLUDE(${GUI_ROOT_DIR}/adm_local/cmake_files/deprecated/FindQWT.cmake)
                             INCLUDE(${GEOM_ROOT_DIR}/adm_local/cmake_files/FindGEOM.cmake)
-                            INCLUDE(${MED_ROOT_DIR}/adm_local/cmake_files/FindMEDFILE.cmake)
-                            INCLUDE(${MED_ROOT_DIR}/adm_local/cmake_files/FindMED.cmake)
+                            INCLUDE(${KERNEL_ROOT_DIR}/salome_adm/cmake_files/SalomeMacros.cmake)
+
+                            INCLUDE(${MED_ROOT_DIR}/adm_local/cmake_files/FindSalomeMED.cmake)
                             INCLUDE(${KERNEL_ROOT_DIR}/salome_adm/cmake_files/FindSPHINX.cmake)
                             """)
                             pass
@@ -660,6 +663,10 @@ class CMakeFile(object):
                             INCLUDE(${CMAKE_SOURCE_DIR}/adm/cmake/FindEXPAT.cmake)
                             INCLUDE(${CMAKE_SOURCE_DIR}/adm/cmake/FindGRAPHVIZ.cmake)
                             INCLUDE(${KERNEL_ROOT_DIR}/salome_adm/cmake_files/FindSPHINX.cmake)
+
+                            SET(PLATFORM_CPPFLAGS ${PLATFORM_CPPFLAGS} -D_SECURE_SCL=0)
+                            SET(PLATFORM_CPPFLAGS ${PLATFORM_CPPFLAGS} -D_SECURE_SCL_THROWS=0)
+                            SET(PLATFORM_CPPFLAGS ${PLATFORM_CPPFLAGS} -D_HAS_ITERATOR_DEBUGGING=0) # To avoid runtime error during checking iterators
                             """)
                             pass
                         if self.module == "jobmanager":
@@ -809,10 +816,10 @@ class CMakeFile(object):
                 pass
             # --
             newlines.append("""
-            set(VERSION 7.1.0)
-            set(SHORT_VERSION 7.1)
-            set(XVERSION 0x070100)
-            set(VERSION_DEV 1)
+            set(VERSION 7.2.0)
+            set(SHORT_VERSION 7.2)
+            set(XVERSION 0x070200)
+            set(VERSION_DEV 0)
             """)
             pass
         # --
@@ -980,7 +987,13 @@ class CMakeFile(object):
         # Replace the $(TOTO) by ${TOTO}
         # Replace the @TOTO@  by ${TOTO}
         # --
-        line = p_dollar.sub(r"${\1}", line)
+        # VSR 15.04.2013 - process nesting substitutions properly, e.g. $(aaa$(bbb))
+        #line = p_dollar.sub(r"${\1}", line)
+        m_dollar = p_dollar.search(line)
+        while m_dollar:
+            line = p_dollar.sub(r"${\1}", line)
+            m_dollar = p_dollar.search(line)
+            pass
         line = p_arobas.sub(r"${\1}", line)
         
         # --
@@ -1828,6 +1841,7 @@ class CMakeFile(object):
         ''')
         # --
         newlines.append(r'''
+        STRING(REPLACE "-module" "" ${amname}_LDFLAGS "${${amname}_LDFLAGS}")
         SET(libs ${PLATFORM_LIBADD} ${PLATFORM_LDFLAGS} ${LDADD} ${${amname}_LIBADD} ${${amname}_LDADD} ${${amname}_LDFLAGS})
         FOREACH(lib SALOMEBasics SalomeBatch)
         IF(name STREQUAL lib)