]> SALOME platform Git repositories - modules/kernel.git/blob - idl/CMakeLists.txt
Salome HOME
#19007 [CEA][Windows] SALOME non regression tests on Windows: fix KERNEL_SALOME_COMMA...
[modules/kernel.git] / idl / CMakeLists.txt
1 # Copyright (C) 2012-2020  CEA/DEN, EDF R&D, OPEN CASCADE
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, or (at your option) any later version.
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 INCLUDE(${CONFIGURATION_ROOT_DIR}/cmake/UseOmniORB.cmake)
21
22 INCLUDE_DIRECTORIES(
23   ${OMNIORB_INCLUDE_DIR}
24   ${CMAKE_CURRENT_BINARY_DIR}
25 )
26
27 SALOME_CONFIGURE_FILE(Calcium_Ports.idl.in Calcium_Ports.idl)
28
29 SET(SalomeIDLKernel_IDLSOURCES
30   SALOME_Exception.idl
31   SALOME_Comm.idl
32   SALOME_ModuleCatalog.idl
33   SALOME_ResourcesManager.idl
34   SALOME_Launcher.idl
35   SALOMEDS.idl
36   SALOMEDS_Attributes.idl
37   SALOME_Component.idl
38   SALOME_ContainerManager.idl
39   SALOME_SDS.idl
40   SALOME_Registry.idl
41   Logger.idl
42   SALOME_GenericObj.idl
43   SALOME_Types.idl
44   SALOME_Session.idl
45   nstest.idl
46   DSC_Engines.idl
47   SALOME_Ports.idl
48   SALOME_PyNode.idl
49   Palm_Ports.idl
50   SALOME_PACOExtension.idl
51   SALOME_ParamPorts.idl
52   SALOME_Parametric.idl
53   SALOME_MPIObject.idl
54   SALOME_TestComponent.idl
55   SALOME_TestModuleCatalog.idl
56   SALOME_CommonTypes.idl
57   SALOME_ExternalServerLauncher.idl
58   ${CMAKE_CURRENT_BINARY_DIR}/Calcium_Ports.idl
59 )
60
61 IF(SALOME_USE_MPI)
62   SET(SalomeIDLKernel_IDLSOURCES ${SalomeIDLKernel_IDLSOURCES} SALOME_MPIContainer.idl SALOME_TestMPIComponent.idl)
63 ENDIF(SALOME_USE_MPI)
64
65 SET(IDL_INCLUDE_DIRS
66   ${CMAKE_CURRENT_SOURCE_DIR}
67   ${CMAKE_CURRENT_BINARY_DIR}
68 )
69
70 SET(COMMON_FLAGS ${OMNIORB_DEFINITIONS})
71 SET(TYPE)
72 IF(WIN32)
73   SET(COMMON_FLAGS "${COMMON_FLAGS} -DNOGDI")
74   SET(TYPE STATIC)
75 ELSE(WIN32)
76   SET(TYPE SHARED)
77 ENDIF(WIN32)
78
79 OMNIORB_ADD_MODULE(SalomeIDLKernel "${SalomeIDLKernel_IDLSOURCES}" "${IDL_INCLUDE_DIRS}")
80 ADD_DEFINITIONS(${COMMON_FLAGS})
81 TARGET_LINK_LIBRARIES(SalomeIDLKernel ${OMNIORB_LIBRARIES})
82
83 INSTALL(TARGETS SalomeIDLKernel EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_LIBS})
84
85 IF(SALOME_PACO_PARALLEL)
86
87   SET(SalomeParallelIDLKernel_PACO_XML_FILES
88     SALOME_Component.xml
89     SALOME_Ports.xml
90     DSC_Engines.xml
91     SALOME_PACOExtension.xml
92     SALOME_ParamPorts.xml
93     SALOME_GenericObj.xml
94   )
95
96   SET(SalomeParallelIDLKernel_SALOME_Component_GEN_PACO_SOURCES
97     SALOME_ComponentPaCO_Engines_Container_server.cxx
98         SALOME_ComponentPaCO_Engines_Container_client.cxx
99         SALOME_ComponentPaCO_Engines_EngineComponent_server.cxx
100         SALOME_ComponentPaCO_Engines_EngineComponent_client.cxx
101         SALOME_ComponentPaCO_Engines_fileTransfer_server.cxx
102         SALOME_ComponentPaCO_Engines_fileTransfer_client.cxx
103         SALOME_ComponentPaCO_Engines_Salome_file_server.cxx
104         SALOME_ComponentPaCO_Engines_Salome_file_client.cxx
105   )
106
107   SET(SalomeParallelIDLKernel_SALOME_Ports_GEN_PACO_SOURCES
108         SALOME_PortsPaCO_Ports_Port_server.cxx
109         SALOME_PortsPaCO_Ports_Port_client.cxx
110         SALOME_PortsPaCO_Ports_Data_Port_server.cxx
111         SALOME_PortsPaCO_Ports_Data_Port_client.cxx
112   )
113
114   SET(SalomeParallelIDLKernel_DSC_Engines_GEN_PACO_SOURCES
115         DSC_EnginesPaCO_Engines_DSC_server.cxx
116         DSC_EnginesPaCO_Engines_DSC_client.cxx
117         DSC_EnginesPaCO_Engines_Superv_Component_server.cxx
118         DSC_EnginesPaCO_Engines_Superv_Component_client.cxx
119   )
120
121   SET(SalomeParallelIDLKernel_SALOME_PACOExtension_GEN_PACO_SOURCES
122         SALOME_PACOExtensionPaCO_Engines_Parallel_Component_server.cxx
123         SALOME_PACOExtensionPaCO_Engines_Parallel_Component_client.cxx
124         SALOME_PACOExtensionPaCO_Engines_PACO_Container_server.cxx
125         SALOME_PACOExtensionPaCO_Engines_PACO_Container_client.cxx
126         SALOME_PACOExtensionPaCO_Engines_Parallel_Salome_file_server.cxx
127         SALOME_PACOExtensionPaCO_Engines_Parallel_Salome_file_client.cxx
128         SALOME_PACOExtensionPaCO_Engines_Parallel_DSC_server.cxx
129         SALOME_PACOExtensionPaCO_Engines_Parallel_DSC_client.cxx
130   )
131
132   SET(SalomeParallelIDLKernel_SALOME_ParamPorts_GEN_PACO_SOURCES
133         SALOME_ParamPortsPaCO_Ports_Param_Double_Port_server.cxx
134         SALOME_ParamPortsPaCO_Ports_Param_Double_Port_client.cxx
135   )
136
137   SET(SalomeParallelIDLKernel_SALOME_GenericObj_GEN_PACO_SOURCES
138         SALOME_GenericObjPaCO_SALOME_GenericObj_server.cxx
139         SALOME_GenericObjPaCO_SALOME_GenericObj_client.cxx
140   )
141
142   SET(SalomeParallelIDLKernel_PAR_SOURCES)
143   SET(SalomeParallelIDLKernel_GEN_PACO_SOURCES)
144   FOREACH(input ${SalomeParallelIDLKernel_PACO_XML_FILES})
145     GET_FILENAME_COMPONENT(base ${input} NAME_WE)
146     SET(input ${CMAKE_CURRENT_SOURCE_DIR}/${input})
147     SET(baseidl ${CMAKE_CURRENT_SOURCE_DIR}/${base}.idl)
148     SET(basehdr ${CMAKE_CURRENT_BINARY_DIR}/${base}.hxx)
149     SET(genidl ${CMAKE_CURRENT_BINARY_DIR}/${base}PaCO.idl)
150     SET(parsrc ${CMAKE_CURRENT_BINARY_DIR}/${base}PaCO.cxx)
151     SET(parhdr ${CMAKE_CURRENT_BINARY_DIR}/${base}PaCO.hxx)
152     SET(genpacosrc)
153     SET(genpacohdr)
154     FOREACH(genpacosrcname ${SalomeParallelIDLKernel_${base}_GEN_PACO_SOURCES})
155       GET_FILENAME_COMPONENT(genpacobase ${genpacosrcname} NAME_WE)
156       LIST(APPEND genpacosrc ${CMAKE_CURRENT_BINARY_DIR}/${genpacosrcname})
157       LIST(APPEND genpacohdr ${CMAKE_CURRENT_BINARY_DIR}/${genpacobase}.hxx)
158     ENDFOREACH(genpacosrcname ${SalomeParallelIDLKernel_${base}_GEN_PACO_SOURCES})
159     LIST(APPEND SalomeParallelIDLKernel_PAR_SOURCES ${parsrc})
160     LIST(APPEND SalomeParallelIDLKernel_GEN_PACO_SOURCES ${genpacosrc})
161     ADD_CUSTOM_COMMAND(OUTPUT ${genidl} ${parsrc} ${parhdr} ${genpacosrc} ${genpacohdr}
162       COMMAND ${OMNIORB_IDL_COMPILER} -p${PACO_ROOT_DIR}/lib/python -bpaco -Wb${input},${CMAKE_CURRENT_SOURCE_DIR}:${PACO_ROOT_DIR}/idl ${baseidl}
163       DEPENDS ${input} ${baseidl})
164     INSTALL(FILES ${input} ${genidl} DESTINATION ${SALOME_INSTALL_IDLS})
165     INSTALL(FILES ${basehdr} ${parhdr} ${genpacohdr} DESTINATION ${SALOME_INSTALL_HEADERS})
166     IF(OMNIORB_PYTHON_BACKEND)
167       SET(IDLPYFLAGS "-bpython -p${OMNIORB_PYTHON_BACKEND} -I${CMAKE_CURRENT_SOURCE_DIR} -I${PACO_ROOT_DIR}/idl")
168       INSTALL(CODE "OMNIORB_COMPILE_IDL_FORPYTHON_ON_INSTALL( \"${OMNIORB_IDL_COMPILER}\" \"${IDLPYFLAGS}\" \"${genidl}\" \"${CMAKE_INSTALL_PREFIX}/\${INSTALL_PYIDL_DIR}\" )")
169     ENDIF(OMNIORB_PYTHON_BACKEND)
170   ENDFOREACH(input ${SalomeParallelIDLKernel_PACO_XML_FILES})
171
172   SET(SalomeParallelIDLKernel_PAR_INCLUDES
173     SALOME_Exception.hxx
174     SALOME_GenericObj.hxx
175     SALOMEDS.hxx
176     SALOME_PyNode.hxx
177   )
178
179   FOREACH(output ${SalomeParallelIDLKernel_PAR_INCLUDES})
180     GET_FILENAME_COMPONENT(base ${output} NAME_WE)
181     SET(baseidl ${CMAKE_CURRENT_SOURCE_DIR}/${base}.idl)
182     ADD_CUSTOM_COMMAND(OUTPUT ${output}
183       COMMAND ${OMNIORB_IDL_COMPILER} -bcxx -Wbh=.hxx -Wbs=.cxx ${baseidl}
184       DEPENDS ${baseidl})
185   ENDFOREACH(output ${SalomeParallelIDLKernel_PAR_INCLUDES})
186   ADD_CUSTOM_TARGET(BUILD_PAR_INCLUDES DEPENDS ${SalomeParallelIDLKernel_PAR_INCLUDES})
187
188   INCLUDE_DIRECTORIES(${PACO_INCLUDE_DIRS})
189   ADD_LIBRARY(SalomeParallelIDLKernel
190     ${SalomeParallelIDLKernel_PAR_SOURCES}
191     ${SalomeParallelIDLKernel_GEN_PACO_SOURCES}
192   )
193   ADD_DEPENDENCIES(SalomeParallelIDLKernel BUILD_PAR_INCLUDES)
194
195   INSTALL(TARGETS SalomeParallelIDLKernel EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_LIBS})
196 ENDIF()