From: adam Date: Mon, 4 Jan 2010 11:35:50 +0000 (+0000) Subject: Fix multiple definitions in swig options X-Git-Tag: PARAVIS_29012010~19 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=40905d1e699d214a061135f3b86c42a9bb338831;p=modules%2Fkernel.git Fix multiple definitions in swig options --- diff --git a/salome_adm/cmake_files/am2cmake.py b/salome_adm/cmake_files/am2cmake.py index 8939f6103..a92eec6a6 100644 --- a/salome_adm/cmake_files/am2cmake.py +++ b/salome_adm/cmake_files/am2cmake.py @@ -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} ) ''')