From 3d19cb277519def26b2b7d08450bfe251fb00aa1 Mon Sep 17 00:00:00 2001 From: adam Date: Thu, 22 Jan 2009 13:20:17 +0000 Subject: [PATCH] compatibility medfile (continue) --- salome_adm/cmake_files/am2cmake.py | 60 +++++++++++++++++++++++------- 1 file changed, 47 insertions(+), 13 deletions(-) diff --git a/salome_adm/cmake_files/am2cmake.py b/salome_adm/cmake_files/am2cmake.py index 439fa0c54..6f75f16b0 100644 --- a/salome_adm/cmake_files/am2cmake.py +++ b/salome_adm/cmake_files/am2cmake.py @@ -970,8 +970,26 @@ class CMakeFile(object): # -- newlines.append(r''' SET(srcs) - SET(srcs ${srcs} ${${amname}_SOURCES}) - SET(srcs ${srcs} ${dist_${amname}_SOURCES}) + FOREACH(src ${${amname}_SOURCES} ${dist_${amname}_SOURCES}) + GET_FILENAME_COMPONENT(ext ${src} EXT) + IF(ext STREQUAL .f) + SET(input ${CMAKE_CURRENT_SOURCE_DIR}/${src}) + STRING(REPLACE ".f" ".o" src ${src}) + SET(src ${CMAKE_CURRENT_BINARY_DIR}/${src}) + SET(output ${src}) + IF(WINDOWS) + SET(F77 g77) + ELSE(WINDOWS) + SET(F77 gfortran) + ENDIF(WINDOWS) + ADD_CUSTOM_COMMAND( + OUTPUT ${output} + COMMAND ${F77} -c -o ${output} ${input} + MAIN_DEPENDENCY ${input} + ) + ENDIF(ext STREQUAL .f) + SET(srcs ${srcs} ${src}) + ENDFOREACH(src ${${amname}_SOURCES} ${dist_${amname}_SOURCES}) SET(build_srcs) FOREACH(f ${nodist_${amname}_SOURCES} ${BUILT_SOURCES}) SET(build_srcs ${build_srcs} ${CMAKE_CURRENT_BINARY_DIR}/${f}) @@ -989,15 +1007,14 @@ class CMakeFile(object): # -- self.setCompilationFlags(newlines) # -- - if self.module == "medfile": - newlines.append(r''' - SET_TARGET_PROPERTIES(${name} PROPERTIES VERSION 1.1.5 SOVERSION 1) - ''') - else: - newlines.append(r''' - SET_TARGET_PROPERTIES(${name} PROPERTIES VERSION 0.0.0 SOVERSION 0) - ''') - pass + newlines.append(r''' + SET_TARGET_PROPERTIES(${name} PROPERTIES VERSION 0.0.0 SOVERSION 0) + FOREACH(lib medC med) + IF(lib STREQUAL ${name}) + SET_TARGET_PROPERTIES(${name} PROPERTIES VERSION 1.1.5 SOVERSION 1) + ENDIF(lib STREQUAL ${name}) + ENDFOREACH(lib medC med) + ''') # -- from os.path import basename upper_name = basename(self.root).upper() @@ -1024,14 +1041,31 @@ class CMakeFile(object): SET_TARGET_PROPERTIES(${name} PROPERTIES DEFINE_SYMBOL GEOM_%s_EXPORTS) ENDIF(name STREQUAL GEOMObject) '''%(upper_name)) + newlines.append(r''' + IF(name STREQUAL medC) + SET_TARGET_PROPERTIES(${name} PROPERTIES DEFINE_SYMBOL MEDC_DLL_EXPORTS) + ENDIF(name STREQUAL medC) + ''') + newlines.append(r''' + IF(name STREQUAL med) + SET_TARGET_PROPERTIES(${name} PROPERTIES DEFINE_SYMBOL MED_DLL_EXPORTS) + ENDIF(name STREQUAL med) + ''') # -- self.setLibAdd(newlines) # -- newlines.append(r''' IF(WINDOWS) - IF(name STREQUAL SalomeHDFPersist) + SET(libs) + SET(libs ${libs} SalomeHDFPersist) + SET(libs ${libs} medC) + SET(libs ${libs} medimport) + SET(libs ${libs} medimportcxx) + FOREACH(lib ${libs}) + IF(name STREQUAL ${lib}) SET_TARGET_PROPERTIES(${name} PROPERTIES LINK_FLAGS "/NODEFAULTLIB:LIBCMTD") - ENDIF(name STREQUAL SalomeHDFPersist) + ENDIF(name STREQUAL ${lib}) + ENDFOREACH(lib ${libs}) ENDIF(WINDOWS) ''') # -- -- 2.39.2