Salome HOME
Fix regression (hang-up of build procedure on Linux) caused by latest changes (Window...
[modules/yacs.git] / src / engine_swig / CMakeLists.txt
1 # Copyright (C) 2012-2013  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.
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   -DYACS_PTHREAD
55   )
56 IF(WIN32)
57   ADD_DEFINITIONS(-DNOGDI)
58 ENDIF(WIN32)
59
60 # libraries to link to
61 SET(_link_LIBRARIES
62   YACSlibEngine
63   ${PYTHON_LIBRARIES}
64   ${OMNIORB_LIBRARIES}
65   )
66
67 # --- sources ---
68 SET(pilot_SOURCES
69   ExecutorSwig.cxx
70   )
71 # --- headers ---
72 SET(pilot_HEADERS
73   ExecutorSwig.hxx
74   )
75 # --- sources ---
76 SET(pypilot_SOURCES
77   
78   )
79 # --- headers ---
80 SET(pypilot_HEADERS
81   )
82
83 # --- scripts ---
84 # scripts / swig wrappings
85 SET(_swig_SCRIPTS
86   ${CMAKE_CURRENT_BINARY_DIR}/pilot.py
87   ${CMAKE_CURRENT_BINARY_DIR}/pypilot.py
88 )
89
90 IF(WIN32)
91   SET(SET_CMD set)
92   SET(SEP_CMD &&)
93 ENDIF(WIN32)
94
95 IF(SALOME_BUILD_DOC)
96   ADD_CUSTOM_TARGET(docengine.i
97     ${SET_CMD} DOXSRCDIR=${PROJECT_SOURCE_DIR}/src/engine ${SEP_CMD} ${DOXYGEN_EXECUTABLE} ${PROJECT_SOURCE_DIR}/Misc/Doxyfile
98     COMMAND ${PYTHON_EXECUTABLE} ${PROJECT_SOURCE_DIR}/Misc/doxy2swig.py -n xml/index.xml docengine.i
99     VERBATIM
100     WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
101     )
102 ENDIF(SALOME_BUILD_DOC)
103
104 # --- rules ---
105 SET(ENGINEINCLUDES 
106   Any.hxx     
107   DeploymentTree.hxx  
108   InputDataStreamPort.hxx         
109   OutPort.hxx               
110   SharedPtr.hxx 
111   AnyInputPort.hxx         
112   Dispatcher.hxx      
113   InputPort.hxx                   
114   OutputDataStreamPort.hxx  
115   StaticDefinedComposedNode.hxx 
116   Bloc.hxx                 
117   DynParaLoop.hxx     
118   InvalidExtractionException.hxx  
119   OutputPort.hxx            
120   Switch.hxx 
121   ComponentInstance.hxx    
122   ElementaryNode.hxx  
123   LinkInfo.hxx                    
124   Pool.hxx                  
125   Task.hxx 
126   ComposedNode.hxx         
127   Executor.hxx        
128   Logger.hxx                      
129   Port.hxx                  
130   TypeCode.hxx 
131   ConditionInputPort.hxx   
132   LogRecord.hxx                   
133   Proc.hxx                  
134   Visitor.hxx 
135   Container.hxx            
136   ForEachLoop.hxx     
137   Loop.hxx                        
138   RefCounter.hxx            
139   VisitorSaveSchema.hxx 
140   ConversionException.hxx  
141   ForLoop.hxx         
142   Node.hxx                        
143   Runtime.hxx               
144   VisitorSaveState.hxx 
145   DataFlowPort.hxx         
146   InGate.hxx          
147   OptimizerAlg.hxx                
148   Scheduler.hxx             
149   WhileLoop.hxx 
150   DataPort.hxx             
151   InlineNode.hxx      
152   OptimizerLoop.hxx               
153   ServiceInlineNode.hxx     
154   ComponentDefinition.hxx 
155   DataStreamPort.hxx       
156   InPort.hxx          
157   OutGate.hxx                     
158   ServiceNode.hxx           
159   Catalog.hxx  
160   PropertyInterface.hxx    
161   AnyOutputPort.hxx   
162   Pool.hxx
163   InPropertyPort.hxx
164 )
165 SET(SWIGINCLUDES ${ENGINEINCLUDES} 
166                  "${PROJECT_SOURCE_DIR}/src/bases/yacsconfig.h" 
167                  "ExecutorSwig.hxx")
168 SWIG_ADD_MODULE(pilot   python pilot.i ExecutorSwig.cxx)
169 SWIG_ADD_MODULE(pypilot python pypilot.i)
170 ADD_DEPENDENCIES(_pilot pilot.i engtypemaps.i docengine.i ${SWIGINCLUDES})
171 ADD_DEPENDENCIES(_pypilot pypilot.i pilot.i engtypemaps.i _pilot ${SWIGINCLUDES})
172
173 SWIG_LINK_LIBRARIES(pilot   "${_link_LIBRARIES}")
174 SWIG_LINK_LIBRARIES(pypilot "${_link_LIBRARIES}")
175 IF(WIN32)
176   SET_TARGET_PROPERTIES(_pilot   PROPERTIES DEBUG_OUTPUT_NAME _pilot_d)
177   SET_TARGET_PROPERTIES(_pypilot PROPERTIES DEBUG_OUTPUT_NAME _pypilot_d)
178 ENDIF(WIN32)
179
180 INSTALL(TARGETS ${SWIG_MODULE_pilot_REAL_NAME} ${SWIG_MODULE_pypilot_REAL_NAME} DESTINATION ${SALOME_INSTALL_PYTHON})
181
182 SALOME_INSTALL_SCRIPTS("${_swig_SCRIPTS}"  ${SALOME_INSTALL_PYTHON})