]> SALOME platform Git repositories - modules/yacs.git/blob - src/engine_swig/CMakeLists.txt
Salome HOME
Apply modifications according to changes in KERNEL API.
[modules/yacs.git] / src / engine_swig / CMakeLists.txt
1 # Copyright (C) 2012-2015  CEA/DEN, 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, 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(${SWIG_USE_FILE})
21
22 # --- options ---
23
24 IF(WIN32)                                       # if platform is Windows 64 bit 
25   IF("${CMAKE_SIZEOF_VOID_P}" EQUAL "8")          
26     ADD_DEFINITIONS(/bigobj)                    # to avoid error C1128
27   ENDIF()
28 ENDIF()
29
30 # additional include directories
31 INCLUDE_DIRECTORIES(
32   ${PTHREAD_INCLUDE_DIR}
33   ${OMNIORB_INCLUDE_DIR}
34   ${PYTHON_INCLUDE_DIRS}
35   ${PROJECT_BINARY_DIR}/idl
36   ${PROJECT_BINARY_DIR}
37   ${PROJECT_SOURCE_DIR}/src/bases
38   ${PROJECT_SOURCE_DIR}/src/engine
39   ${CMAKE_CURRENT_SOURCE_DIR}
40   ${CMAKE_CURRENT_BINARY_DIR}
41 )
42
43 # swig flags
44 SET_SOURCE_FILES_PROPERTIES(pilot.i pypilot.i PROPERTIES 
45                                     CPLUSPLUS ON 
46                                     SWIG_DEFINITIONS "-shadow")
47 SET_PROPERTY(SOURCE pilot.i pypilot.i PROPERTY 
48                     SWIG_FLAGS "-noexcept" "-DYACS_PTHREAD")
49
50 # additional preprocessor / compiler flags
51 ADD_DEFINITIONS(
52   ${PYTHON_DEFINITIONS}
53   ${OMNIORB_DEFINITIONS}
54   )
55
56 # libraries to link to
57 SET(_link_LIBRARIES
58   YACSlibEngine
59   ${PYTHON_LIBRARIES}
60   ${OMNIORB_LIBRARIES}
61   )
62
63 # --- sources ---
64 SET(pilot_SOURCES
65   ExecutorSwig.cxx
66   )
67 # --- headers ---
68 SET(pilot_HEADERS
69   ExecutorSwig.hxx
70   )
71 # --- sources ---
72 SET(pypilot_SOURCES
73   
74   )
75 # --- headers ---
76 SET(pypilot_HEADERS
77   )
78
79 # --- scripts ---
80 # scripts / swig wrappings
81 SET(_swig_SCRIPTS
82   ${CMAKE_CURRENT_BINARY_DIR}/pilot.py
83   ${CMAKE_CURRENT_BINARY_DIR}/pypilot.py
84 )
85
86 IF(WIN32)
87   SET(SET_CMD set)
88   SET(SEP_CMD &&)
89 ENDIF(WIN32)
90
91 IF(SALOME_BUILD_DOC)
92   ADD_CUSTOM_TARGET(docengine.i
93     ${SET_CMD} DOXSRCDIR=${PROJECT_SOURCE_DIR}/src/engine ${SEP_CMD} ${DOXYGEN_EXECUTABLE} ${PROJECT_SOURCE_DIR}/Misc/Doxyfile
94     COMMAND ${PYTHON_EXECUTABLE} ${PROJECT_SOURCE_DIR}/Misc/doxy2swig.py -n xml/index.xml docengine.i
95     VERBATIM
96     WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
97     )
98 ENDIF(SALOME_BUILD_DOC)
99
100 # --- rules ---
101 SET(ENGINEINCLUDES 
102   Any.hxx     
103   DeploymentTree.hxx  
104   InputDataStreamPort.hxx         
105   OutPort.hxx               
106   SharedPtr.hxx 
107   AnyInputPort.hxx         
108   Dispatcher.hxx      
109   InputPort.hxx                   
110   OutputDataStreamPort.hxx  
111   StaticDefinedComposedNode.hxx 
112   Bloc.hxx                 
113   DynParaLoop.hxx     
114   InvalidExtractionException.hxx  
115   OutputPort.hxx            
116   Switch.hxx 
117   ComponentInstance.hxx    
118   ElementaryNode.hxx  
119   LinkInfo.hxx                    
120   Pool.hxx                  
121   Task.hxx 
122   ComposedNode.hxx         
123   Executor.hxx        
124   Logger.hxx                      
125   Port.hxx                  
126   TypeCode.hxx 
127   ConditionInputPort.hxx   
128   LogRecord.hxx                   
129   Proc.hxx                  
130   Visitor.hxx 
131   Container.hxx            
132   ForEachLoop.hxx     
133   Loop.hxx                        
134   RefCounter.hxx            
135   VisitorSaveSchema.hxx 
136   ConversionException.hxx  
137   ForLoop.hxx         
138   Node.hxx                        
139   Runtime.hxx               
140   VisitorSaveState.hxx 
141   DataFlowPort.hxx         
142   InGate.hxx          
143   OptimizerAlg.hxx                
144   Scheduler.hxx             
145   WhileLoop.hxx 
146   DataPort.hxx             
147   InlineNode.hxx      
148   OptimizerLoop.hxx               
149   ServiceInlineNode.hxx     
150   ComponentDefinition.hxx 
151   DataStreamPort.hxx       
152   InPort.hxx          
153   OutGate.hxx                     
154   ServiceNode.hxx           
155   Catalog.hxx  
156   PropertyInterface.hxx    
157   AnyOutputPort.hxx   
158   Pool.hxx
159   InPropertyPort.hxx
160 )
161 SET(SWIGINCLUDES ${ENGINEINCLUDES} 
162                  "${PROJECT_SOURCE_DIR}/src/bases/yacsconfig.h" 
163                  "ExecutorSwig.hxx")
164 SWIG_ADD_MODULE(pilot   python pilot.i ExecutorSwig.cxx)
165 SWIG_ADD_MODULE(pypilot python pypilot.i)
166 ADD_DEPENDENCIES(_pilot pilot.i engtypemaps.i docengine.i ${SWIGINCLUDES})
167 ADD_DEPENDENCIES(_pypilot pypilot.i pilot.i engtypemaps.i _pilot ${SWIGINCLUDES})
168
169 SWIG_LINK_LIBRARIES(pilot   "${_link_LIBRARIES}")
170 SWIG_LINK_LIBRARIES(pypilot "${_link_LIBRARIES}")
171 IF(WIN32)
172   SET_TARGET_PROPERTIES(_pilot   PROPERTIES DEBUG_OUTPUT_NAME _pilot_d)
173   SET_TARGET_PROPERTIES(_pypilot PROPERTIES DEBUG_OUTPUT_NAME _pypilot_d)
174 ENDIF(WIN32)
175
176 INSTALL(TARGETS ${SWIG_MODULE_pilot_REAL_NAME} ${SWIG_MODULE_pypilot_REAL_NAME} DESTINATION ${SALOME_INSTALL_PYTHON})
177
178 SALOME_INSTALL_SCRIPTS("${_swig_SCRIPTS}"  ${SALOME_INSTALL_PYTHON})