]> SALOME platform Git repositories - modules/kernel.git/commitdiff
Salome HOME
Fix multiple definitions in swig options
authoradam <adam>
Mon, 4 Jan 2010 11:35:50 +0000 (11:35 +0000)
committeradam <adam>
Mon, 4 Jan 2010 11:35:50 +0000 (11:35 +0000)
salome_adm/cmake_files/am2cmake.py

index 8939f6103c42268dcbe4b51102d6962bf89d7296..a92eec6a69440e17e08676e66106666c3df78f6e 100644 (file)
@@ -1014,9 +1014,22 @@ class CMakeFile(object):
             ELSE(SWIG_SOURCES MATCHES ";")
             SET(SWIG_SOURCES_FIRST "${SWIG_SOURCES}")
             ENDIF(SWIG_SOURCES MATCHES ";")
+            SET(flags)
+            FOREACH(f ${SWIG_FLAGS} ${MY_SWIG_FLAGS})
+            SET(test ON)
+            IF(flags)
+            LIST(FIND flags ${f} index)
+            IF(NOT index EQUAL -1)
+            SET(test OFF)
+            ENDIF(NOT index EQUAL -1)
+            ENDIF(flags)
+            IF(test)
+            SET(flags ${flags} ${f})
+            ENDIF(test)
+            ENDFOREACH(f ${SWIG_FLAGS} ${MY_SWIG_FLAGS})
             ADD_CUSTOM_COMMAND(
             OUTPUT ${build_srcs}
-            COMMAND ${SWIG_EXECUTABLE} ${SWIG_FLAGS} ${MY_SWIG_FLAGS} -o ${build_srcs} ${CMAKE_CURRENT_SOURCE_DIR}/${SWIG_SOURCES_FIRST}
+            COMMAND ${SWIG_EXECUTABLE} ${flags} -o ${build_srcs} ${CMAKE_CURRENT_SOURCE_DIR}/${SWIG_SOURCES_FIRST}
             MAIN_DEPENDENCY ${SWIG_SOURCES}
             )
             ''')