Salome HOME
Merge from V6_main 01/04/2013
[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 "MED_Gen.idl"
66 #include "MED.idl"
67 #include "MEDCouplingCorbaServant.idl"
68 """
69 makefiledefs="""
70 #module MED
71 MED_IDL_INCLUDES = -I$(MED_ROOT_DIR)/idl/salome
72 MED_INCLUDES= -I${MED2HOME}/include -I${MED_ROOT_DIR}/include/salome -DH5_USE_16_API -I${HDF5HOME}/include
73 MED_IDL_LIBS= -L$(MED_ROOT_DIR)/lib/salome -lSalomeIDLMED
74 MED_LIBS= -L${MED2HOME}/lib -lmed -L${HDF5HOME}/lib -lhdf5 -L${MED_ROOT_DIR}/lib/salome -lSalomeIDLMED -lMEDClientcmodule -lmedcouplingcorba -lmedcouplingclient 
75 SALOME_LIBS += ${MED_LIBS}
76 SALOME_IDL_LIBS += ${MED_IDL_LIBS}
77 SALOME_INCLUDES += ${MED_INCLUDES}
78 IDL_INCLUDES += ${MED_IDL_INCLUDES}
79 """
80 configdefs="""
81 if test "x${MED_ROOT_DIR}" != "x" && test -d ${MED_ROOT_DIR} ; then
82   AC_MSG_RESULT(Using MED installation in ${MED_ROOT_DIR})
83 else
84   AC_MSG_ERROR([Cannot find module MED. Have you set MED_ROOT_DIR ?],1)
85 fi
86 """
87
88 salome_modules["MED"]={"idldefs" : idldefs, "makefiledefs" : makefiledefs, "configdefs" : configdefs}
89
90 #module SMESH
91 idldefs="""
92 #include "SMESH_Gen.idl"
93 #include "SMESH_Mesh.idl"
94 """
95 makefiledefs="""
96 #module SMESH
97 SMESH_IDL_INCLUDES = -I$(SMESH_ROOT_DIR)/idl/salome
98 SMESH_INCLUDES= -I$(SMESH_ROOT_DIR)/include/salome
99 SMESH_IDL_LIBS= -L$(SMESH_ROOT_DIR)/lib/salome -lSalomeIDLSMESH
100 SMESH_LIBS= -L$(SMESH_ROOT_DIR)/lib/salome
101 SALOME_LIBS += ${SMESH_LIBS}
102 SALOME_IDL_LIBS += ${SMESH_IDL_LIBS}
103 SALOME_INCLUDES += ${SMESH_INCLUDES}
104 IDL_INCLUDES += ${SMESH_IDL_INCLUDES}
105 """
106 configdefs="""
107 if test "x${SMESH_ROOT_DIR}" != "x" && test -d ${SMESH_ROOT_DIR} ; then
108   AC_MSG_RESULT(Using SMESH installation in ${SMESH_ROOT_DIR})
109 else
110   AC_MSG_ERROR([Cannot find module SMESH. Have you set SMESH_ROOT_DIR ?],1)
111 fi
112 """
113
114 salome_modules["SMESH"]={"idldefs" : idldefs, "makefiledefs" : makefiledefs, "configdefs" : configdefs,
115                          "depends":["GEOM","MED"]}
116
117 #module VISU
118 idldefs="""
119 #include "VISU_Gen.idl"
120 """
121 makefiledefs="""
122 #module VISU
123 VISU_IDL_INCLUDES = -I$(VISU_ROOT_DIR)/idl/salome
124 VISU_INCLUDES= -I$(VISU_ROOT_DIR)/include/salome
125 VISU_IDL_LIBS= -L$(VISU_ROOT_DIR)/lib/salome -lSalomeIDLVISU
126 VISU_LIBS= -L$(VISU_ROOT_DIR)/lib/salome
127 SALOME_LIBS += ${VISU_LIBS}
128 SALOME_IDL_LIBS += ${VISU_IDL_LIBS}
129 SALOME_INCLUDES += ${VISU_INCLUDES}
130 IDL_INCLUDES += ${VISU_IDL_INCLUDES}
131 """
132 configdefs="""
133 if test "x${VISU_ROOT_DIR}" != "x" && test -d ${VISU_ROOT_DIR} ; then
134   AC_MSG_RESULT(Using VISU installation in ${VISU_ROOT_DIR})
135 else
136   AC_MSG_ERROR([Cannot find module VISU. Have you set VISU_ROOT_DIR ?],1)
137 fi
138 """
139
140 salome_modules["VISU"]={"idldefs" : idldefs, "makefiledefs" : makefiledefs, "configdefs" : configdefs}