1 # Copyright (C) 2012-2020 CEA/DEN, EDF R&D, OPEN CASCADE
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.
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.
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
17 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
20 INCLUDE(${CONFIGURATION_ROOT_DIR}/cmake/UseOmniORB.cmake)
23 ${OMNIORB_INCLUDE_DIR}
24 ${CMAKE_CURRENT_BINARY_DIR}
27 SALOME_CONFIGURE_FILE(Calcium_Ports.idl.in Calcium_Ports.idl)
29 SET(SalomeIDLKernel_IDLSOURCES
32 SALOME_ModuleCatalog.idl
33 SALOME_ResourcesManager.idl
36 SALOMEDS_Attributes.idl
38 SALOME_ContainerManager.idl
50 SALOME_PACOExtension.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
62 SET(SalomeIDLKernel_IDLSOURCES ${SalomeIDLKernel_IDLSOURCES} SALOME_MPIContainer.idl SALOME_TestMPIComponent.idl)
66 ${CMAKE_CURRENT_SOURCE_DIR}
67 ${CMAKE_CURRENT_BINARY_DIR}
70 SET(COMMON_FLAGS ${OMNIORB_DEFINITIONS})
73 SET(COMMON_FLAGS "${COMMON_FLAGS} -DNOGDI")
79 OMNIORB_ADD_MODULE(SalomeIDLKernel "${SalomeIDLKernel_IDLSOURCES}" "${IDL_INCLUDE_DIRS}")
80 ADD_DEFINITIONS(${COMMON_FLAGS})
81 TARGET_LINK_LIBRARIES(SalomeIDLKernel ${OMNIORB_LIBRARIES})
83 INSTALL(TARGETS SalomeIDLKernel EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_LIBS})
85 IF(SALOME_PACO_PARALLEL)
87 SET(SalomeParallelIDLKernel_PACO_XML_FILES
91 SALOME_PACOExtension.xml
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
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
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
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
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
137 SET(SalomeParallelIDLKernel_SALOME_GenericObj_GEN_PACO_SOURCES
138 SALOME_GenericObjPaCO_SALOME_GenericObj_server.cxx
139 SALOME_GenericObjPaCO_SALOME_GenericObj_client.cxx
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)
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})
172 SET(SalomeParallelIDLKernel_PAR_INCLUDES
174 SALOME_GenericObj.hxx
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}
185 ENDFOREACH(output ${SalomeParallelIDLKernel_PAR_INCLUDES})
186 ADD_CUSTOM_TARGET(BUILD_PAR_INCLUDES DEPENDS ${SalomeParallelIDLKernel_PAR_INCLUDES})
188 INCLUDE_DIRECTORIES(${PACO_INCLUDE_DIRS})
189 ADD_LIBRARY(SalomeParallelIDLKernel
190 ${SalomeParallelIDLKernel_PAR_SOURCES}
191 ${SalomeParallelIDLKernel_GEN_PACO_SOURCES}
193 ADD_DEPENDENCIES(SalomeParallelIDLKernel BUILD_PAR_INCLUDES)
195 INSTALL(TARGETS SalomeParallelIDLKernel EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_LIBS})