From 40905d1e699d214a061135f3b86c42a9bb338831 Mon Sep 17 00:00:00 2001 From: adam Date: Mon, 4 Jan 2010 11:35:50 +0000 Subject: [PATCH] Fix multiple definitions in swig options --- salome_adm/cmake_files/am2cmake.py | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) 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} ) ''') -- 2.39.2