]> SALOME platform Git repositories - tools/yacsgen.git/blob - module_generator/salomemodules.py
Salome HOME
Patch for SALOME 7.3 (take into account removal of MEDMEM API) - from N.Crouzet
[tools/yacsgen.git] / module_generator / salomemodules.py
1 # Copyright (C) 2009-2013  EDF R&D
2 #
3 # This library is free software; you can redistribute it and/or
4 # modify it under the terms of the GNU Lesser General Public
5 # License as published by the Free Software Foundation; either
6 # version 2.1 of the License.
7 #
8 # This library is distributed in the hope that it will be useful,
9 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
11 # Lesser General Public License for more details.
12 #
13 # You should have received a copy of the GNU Lesser General Public
14 # License along with this library; if not, write to the Free Software
15 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
16 #
17 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
18 #
19
20 #######################################################################
21 #         SALOME modules                                              #
22 #######################################################################
23 salome_modules={}
24
25 def add_module(module,idldefs="",makefiledefs="",configdefs=""):
26   """ add a module configuration for other module than KERNEL
27
28        :param module: module name (GEOM, SMESH, VISU, ...)
29        :type module: string
30        :param idldefs:  definition instructions to add to idl files when using this module
31        :type idldefs: string
32        :param makefiledefs:  definition instructions to add to Makefile files when using this module
33        :type makefiledefs: string
34        :param configdefs:  instructions to add to configure file when using this module
35        :type configdefs: string
36   """
37   salome_modules[module]={"idldefs" : idldefs, "makefiledefs" : makefiledefs, "configdefs" : configdefs}
38
39 #module GEOM
40 idldefs="""
41 #include "GEOM_Gen.idl"
42 """
43 makefiledefs="""
44 #module GEOM
45 GEOM_IDL_INCLUDES = -I$(GEOM_ROOT_DIR)/idl/salome
46 GEOM_INCLUDES= -I$(GEOM_ROOT_DIR)/include/salome
47 GEOM_IDL_LIBS= -L$(GEOM_ROOT_DIR)/lib/salome -lSalomeIDLGEOM
48 GEOM_LIBS= -L$(GEOM_ROOT_DIR)/lib/salome
49 SALOME_LIBS += ${GEOM_LIBS}
50 SALOME_IDL_LIBS += ${GEOM_IDL_LIBS}
51 SALOME_INCLUDES += ${GEOM_INCLUDES}
52 IDL_INCLUDES += ${GEOM_IDL_INCLUDES}
53 """
54 configdefs="""
55 if test "x${GEOM_ROOT_DIR}" != "x" && test -d ${GEOM_ROOT_DIR} ; then
56   AC_MSG_RESULT(Using GEOM installation in ${GEOM_ROOT_DIR})
57 else
58   AC_MSG_ERROR([Cannot find module GEOM. Have you set GEOM_ROOT_DIR ?],1)
59 fi
60 """
61 add_module("GEOM",idldefs,makefiledefs,configdefs)
62
63 #module MED
64 idldefs="""
65 #include "MEDCouplingCorbaServant.idl"
66 """
67 makefiledefs="""
68 #module MED
69 MED_IDL_INCLUDES = -I$(MED_ROOT_DIR)/idl/salome
70 MED_INCLUDES= -I${MED2HOME}/include -I${MED_ROOT_DIR}/include/salome -DH5_USE_16_API -I${HDF5HOME}/include
71 MED_IDL_LIBS= -L$(MED_ROOT_DIR)/lib/salome -lSalomeIDLMED
72 MED_LIBS= -L${MED2HOME}/lib -lmed -L${HDF5HOME}/lib -lhdf5 -L${MED_ROOT_DIR}/lib/salome -lSalomeIDLMED -lmedcouplingcorba -lmedcouplingclient 
73 SALOME_LIBS += ${MED_LIBS}
74 SALOME_IDL_LIBS += ${MED_IDL_LIBS}
75 SALOME_INCLUDES += ${MED_INCLUDES}
76 IDL_INCLUDES += ${MED_IDL_INCLUDES}
77 """
78 configdefs="""
79 if test "x${MED_ROOT_DIR}" != "x" && test -d ${MED_ROOT_DIR} ; then
80   AC_MSG_RESULT(Using MED installation in ${MED_ROOT_DIR})
81 else
82   AC_MSG_ERROR([Cannot find module MED. Have you set MED_ROOT_DIR ?],1)
83 fi
84 """
85
86 salome_modules["MED"]={"idldefs" : idldefs, "makefiledefs" : makefiledefs, "configdefs" : configdefs}
87
88 #module SMESH
89 idldefs="""
90 #include "SMESH_Gen.idl"
91 #include "SMESH_Mesh.idl"
92 """
93 makefiledefs="""
94 #module SMESH
95 SMESH_IDL_INCLUDES = -I$(SMESH_ROOT_DIR)/idl/salome
96 SMESH_INCLUDES= -I$(SMESH_ROOT_DIR)/include/salome
97 SMESH_IDL_LIBS= -L$(SMESH_ROOT_DIR)/lib/salome -lSalomeIDLSMESH
98 SMESH_LIBS= -L$(SMESH_ROOT_DIR)/lib/salome
99 SALOME_LIBS += ${SMESH_LIBS}
100 SALOME_IDL_LIBS += ${SMESH_IDL_LIBS}
101 SALOME_INCLUDES += ${SMESH_INCLUDES}
102 IDL_INCLUDES += ${SMESH_IDL_INCLUDES}
103 """
104 configdefs="""
105 if test "x${SMESH_ROOT_DIR}" != "x" && test -d ${SMESH_ROOT_DIR} ; then
106   AC_MSG_RESULT(Using SMESH installation in ${SMESH_ROOT_DIR})
107 else
108   AC_MSG_ERROR([Cannot find module SMESH. Have you set SMESH_ROOT_DIR ?],1)
109 fi
110 """
111
112 salome_modules["SMESH"]={"idldefs" : idldefs, "makefiledefs" : makefiledefs, "configdefs" : configdefs,
113                          "depends":["GEOM","MED"]}
114
115 #module VISU
116 idldefs="""
117 #include "VISU_Gen.idl"
118 """
119 makefiledefs="""
120 #module VISU
121 VISU_IDL_INCLUDES = -I$(VISU_ROOT_DIR)/idl/salome
122 VISU_INCLUDES= -I$(VISU_ROOT_DIR)/include/salome
123 VISU_IDL_LIBS= -L$(VISU_ROOT_DIR)/lib/salome -lSalomeIDLVISU
124 VISU_LIBS= -L$(VISU_ROOT_DIR)/lib/salome
125 SALOME_LIBS += ${VISU_LIBS}
126 SALOME_IDL_LIBS += ${VISU_IDL_LIBS}
127 SALOME_INCLUDES += ${VISU_INCLUDES}
128 IDL_INCLUDES += ${VISU_IDL_INCLUDES}
129 """
130 configdefs="""
131 if test "x${VISU_ROOT_DIR}" != "x" && test -d ${VISU_ROOT_DIR} ; then
132   AC_MSG_RESULT(Using VISU installation in ${VISU_ROOT_DIR})
133 else
134   AC_MSG_ERROR([Cannot find module VISU. Have you set VISU_ROOT_DIR ?],1)
135 fi
136 """
137
138 salome_modules["VISU"]={"idldefs" : idldefs, "makefiledefs" : makefiledefs, "configdefs" : configdefs}