From dc5832d1d19c8a00ed85f4c3df90e71e3d20f776 Mon Sep 17 00:00:00 2001 From: adam Date: Tue, 3 Feb 2009 10:43:18 +0000 Subject: [PATCH] compatibility smesh (end) --- salome_adm/cmake_files/am2cmake.py | 65 ++++++++++++++++++++++++++++++ 1 file changed, 65 insertions(+) diff --git a/salome_adm/cmake_files/am2cmake.py b/salome_adm/cmake_files/am2cmake.py index 26ab21a36..1df50f057 100644 --- a/salome_adm/cmake_files/am2cmake.py +++ b/salome_adm/cmake_files/am2cmake.py @@ -505,6 +505,11 @@ class CMakeFile(object): SET(MED_ENABLE_GUI ON) """) pass + elif self.module == "smesh": + newlines.append(""" + SET(SMESH_ENABLE_GUI ON) + """) + pass # -- pass # -- @@ -957,6 +962,21 @@ class CMakeFile(object): ''') # -- newlines.append(r''' + IF(WINDOWS) + SET(targets) + SET(targets ${targets} MEFISTO2D) + FOREACH(target ${targets}) + IF(name STREQUAL ${target}) + SET(dir $ENV{F2CHOME}) + STRING(REPLACE "\\\\" "/" dir ${dir}) + SET(libadd ${libadd} ${dir}/LIBF77.lib) + SET(libadd ${libadd} ${dir}/LIBI77.lib) + ENDIF(name STREQUAL ${target}) + ENDFOREACH(target ${targets}) + ENDIF(WINDOWS) + ''') + # -- + newlines.append(r''' SET(libs ${${amname}_LIBADD} ${${amname}_LDADD} ${${amname}_LDFLAGS}) ''') if key == "bin_PROGRAMS": @@ -998,6 +1018,13 @@ class CMakeFile(object): SET_TARGET_PROPERTIES(${name} PROPERTIES LINK_FLAGS "/NODEFAULTLIB:LIBCMTD") ENDIF(name STREQUAL ${target}) ENDFOREACH(target ${targets}) + SET(targets) + SET(targets ${targets} MEFISTO2D) + FOREACH(target ${targets}) + IF(name STREQUAL ${target}) + SET_TARGET_PROPERTIES(${name} PROPERTIES LINK_FLAGS "/NODEFAULTLIB:MSVCRT") + ENDIF(name STREQUAL ${target}) + ENDFOREACH(target ${targets}) ENDIF(WINDOWS) ''') # -- @@ -1023,6 +1050,7 @@ class CMakeFile(object): SET(targets ${targets} GEOMEngine) SET(targets ${targets} MEDEngine) SET(targets ${targets} SMESHEngine) + SET(targets ${targets} SMESH) FOREACH(target ${targets}) IF(name STREQUAL ${target}) SET(var ${var} -DNOGDI) @@ -1033,6 +1061,20 @@ class CMakeFile(object): # -- newlines.append(r''' IF(WINDOWS) + SET(targets) + SET(targets ${targets} MEFISTO2D) + FOREACH(target ${targets}) + IF(name STREQUAL ${target}) + SET(dir $ENV{F2CHOME}) + STRING(REPLACE "\\\\" "/" dir ${dir}) + SET(var ${var} -I${dir}) + ENDIF(name STREQUAL ${target}) + ENDFOREACH(target ${targets}) + ENDIF(WINDOWS) + ''') + # -- + newlines.append(r''' + IF(WINDOWS) SET(var ${var} -D_USE_MATH_DEFINES) ENDIF(WINDOWS) ''') @@ -1121,6 +1163,17 @@ class CMakeFile(object): FOREACH(src ${${amname}_SOURCES} ${dist_${amname}_SOURCES}) GET_FILENAME_COMPONENT(ext ${src} EXT) IF(ext STREQUAL .f) + IF(src STREQUAL trte.f) + SET(input ${CMAKE_CURRENT_SOURCE_DIR}/${src}) + STRING(REPLACE ".f" ".c" src ${src}) + SET(src ${CMAKE_CURRENT_BINARY_DIR}/${src}) + SET(output ${src}) + ADD_CUSTOM_COMMAND( + OUTPUT ${output} + COMMAND f2c ${input} + MAIN_DEPENDENCY ${input} + ) + ELSE(src STREQUAL trte.f) SET(input ${CMAKE_CURRENT_SOURCE_DIR}/${src}) STRING(REPLACE ".f" ".o" src ${src}) SET(src ${CMAKE_CURRENT_BINARY_DIR}/${src}) @@ -1135,6 +1188,7 @@ class CMakeFile(object): COMMAND ${F77} -c -o ${output} ${input} MAIN_DEPENDENCY ${input} ) + ENDIF(src STREQUAL trte.f) ENDIF(ext STREQUAL .f) SET(srcs ${srcs} ${src}) ENDFOREACH(src ${${amname}_SOURCES} ${dist_${amname}_SOURCES}) @@ -1178,6 +1232,7 @@ class CMakeFile(object): newlines.append(r''' SET_TARGET_PROPERTIES(${name} PROPERTIES DEFINE_SYMBOL %s_EXPORTS) '''%(upper_name)) + # -- newlines.append(r''' IF(name STREQUAL SalomeLauncher) SET_TARGET_PROPERTIES(${name} PROPERTIES DEFINE_SYMBOL SALOME%s_EXPORTS) @@ -1278,6 +1333,16 @@ class CMakeFile(object): SET_TARGET_PROPERTIES(${name} PROPERTIES DEFINE_SYMBOL MEFISTO2D_EXPORTS) ENDIF(name STREQUAL MEFISTO2D) ''') + newlines.append(r''' + IF(name STREQUAL SMESHObject) + SET_TARGET_PROPERTIES(${name} PROPERTIES DEFINE_SYMBOL SMESHOBJECT_EXPORTS) + ENDIF(name STREQUAL SMESHObject) + ''') + newlines.append(r''' + IF(name STREQUAL _libSMESH_Swig) + SET_TARGET_PROPERTIES(${name} PROPERTIES DEFINE_SYMBOL SMESH_SWIG_EXPORTS) + ENDIF(name STREQUAL _libSMESH_Swig) + ''') # -- self.setLibAdd(key, newlines) # -- -- 2.39.2