Salome HOME
Minor: vtkEDFCutter removed from CMakeLists.txt
[modules/paravis.git] / src / PVGUI / CMakeLists.txt
1 # Copyright (C) 2010-2014  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(UseQt4Ext)
21
22 # --- options ---
23
24 INCLUDE_DIRECTORIES(${OMNIORB_INCLUDE_DIR} 
25     ${KERNEL_INCLUDE_DIRS}
26     ${GUI_INCLUDE_DIRS} 
27     ${PROJECT_BINARY_DIR}/idl 
28     ${PROJECT_BINARY_DIR} 
29     ${CAS_INCLUDE_DIRS} 
30     ${Boost_INCLUDE_DIRS}
31     ${QT_INCLUDES}
32     ${CMAKE_CURRENT_SOURCE_DIR}
33     ${CMAKE_CURRENT_BINARY_DIR}
34     )
35
36 # additional preprocessor / compiler flags
37 ADD_DEFINITIONS(${CAS_DEFINITIONS})
38 ADD_DEFINITIONS(${KERNEL_DEFINITIONS})
39 ADD_DEFINITIONS(${OMNIORB_DEFINITIONS})
40
41 # libraries to link to
42 SET(_PARAVIEW_APP_COMPO_LIB
43   pqApplicationComponents
44   )
45
46 SET(_link_LIBRARIES 
47   ${OMNIORB_LIBRARIES}
48   ${QT_LIBRARIES}
49   ${CAS_KERNEL}
50   ${PYTHON_LIBS}
51   ${KERNEL_LDFLAGS} ${KERNEL_SalomeDS} ${KERNEL_SALOMELocalTrace} ${KERNEL_SalomeIDLKernel} 
52                     ${KERNEL_SalomeNS} ${KERNEL_SalomeLifeCycleCORBA} ${KERNEL_SalomeContainer} ${KERNEL_TOOLSDS}
53   ${GUI_LDFLAGS} ${GUI_SalomeApp} ${GUI_LightApp} ${GUI_CAM} ${GUI_qtx} ${GUI_suit} ${GUI_Event} ${GUI_PyInterp} 
54                  ${GUI_SalomeObject} ${GUI_vtkTools}
55   ${MED_SalomeIDLMED}
56   ${_PARAVIEW_APP_COMPO_LIB}
57   SalomeIDLPARAVIS
58 )
59
60 # --- headers ---
61
62 SET(_ui_files
63     resources/pqCustomSettingsWidget.ui
64     )
65
66 QT4_WRAP_UI(_ui_FORMS_HEADERS ${_ui_files})
67
68 # header files / to be processed by moc
69 SET(_moc_HEADERS
70   PVGUI_Module.h
71   PVGUI_ViewManager.h
72   PVGUI_ViewModel.h
73   PVGUI_ViewWindow.h
74   PVGUI_ParaViewSettingsPane.h
75 )
76
77 # header files / no moc processing
78 SET(_other_HEADERS
79   PVGUI_OutputWindowAdapter.h
80   PVGUI_Tools.h
81   #PVGUI_MatplotlibMathTextUtilities.h
82   PV_I.h
83   PARAVIS_Gen_i.hh
84   PV_Events.h
85   PV_Tools.h
86 )
87
88 # header files / to install
89 SET(PVGUI_HEADERS ${_moc_HEADERS} ${_other_HEADERS} ${_ui_FORMS_HEADERS})
90
91 # --- resources ---
92
93 # resource files / to be processed by lrelease
94 SET(_ts_RESOURCES
95   resources/PARAVIS_images.ts
96   resources/PARAVIS_msg_en.ts
97   resources/PARAVIS_msg_fr.ts
98   resources/PARAVIS_msg_ja.ts
99 )
100
101 # resource files / static
102 SET(_other_RESOURCES
103   # sampleservers.pvsc ???
104 )
105
106 IF(SALOME_BUILD_DOC)
107   # --- ParaView documentation is built as a resource ---
108   # Check ParaView documentation file existence
109   # if it exists add it to the resources (compile into binary form)
110   # otherwise print warning message
111   SET(PV_DOC_FILE ${VTK_INSTALL_PREFIX}/share/doc/paraview-${PARAVIEW_VERSION_MAJOR}.${PARAVIEW_VERSION_MINOR}/paraview.qch)
112   IF (EXISTS ${PV_DOC_FILE})
113     SET(RC_SOURCE ${CMAKE_CURRENT_SOURCE_DIR}/PVGUI.qrc.in)
114     SET(RC_GENERATED ${CMAKE_CURRENT_BINARY_DIR}/PVGUI.qrc)
115     MESSAGE(STATUS "Creation of ${RC_GENERATED}")
116     CONFIGURE_FILE(${RC_SOURCE} ${RC_GENERATED})
117     SET(_rcc_RESOURCES ${RC_GENERATED})
118     ADD_DEFINITIONS(-DHAS_PV_DOC)
119   ELSE ()
120     MESSAGE(WARNING "Help file for ParaView has not been found! ParaView documentation will not be available.")
121   ENDIF ()
122 ENDIF()
123
124 # --- sources ---
125
126 # sources / rcc wrappings
127 QT4_ADD_RESOURCES(_rcc_SOURCES ${_rcc_RESOURCES})
128
129 # sources / moc wrappings
130 QT4_WRAP_CPP(_moc_SOURCES ${_moc_HEADERS})
131
132 # sources / EDF specific stuff
133 #INCLUDE(vtkWrapClientServer)
134 #VTK_WRAP_ClientServer(vtkEDFCutterCS vtkEDFCutter_SRCS ${GUI_ROOT_DIR}/include/salome/vtkEDFCutter.h)
135
136 # sources / static
137 SET(_other_SOURCES
138   PVGUI_Module.cxx
139   PVGUI_Module_actions.cxx
140   PVGUI_Module_widgets.cxx
141   PVGUI_ViewManager.cxx
142   PVGUI_ViewModel.cxx
143   PVGUI_ViewWindow.cxx
144   PVGUI_OutputWindowAdapter.cxx
145   PVGUI_Tools.cxx
146   PVGUI_ParaViewSettingsPane.cxx
147   #PVGUI_MatplotlibMathTextUtilities.cxx
148   PARAVIS_Gen_i.cc
149   PV_Tools.cxx
150   )
151
152 IF(NOT SALOME_PARAVIS_MINIMAL_CORBA)
153   # Generate headers and sources corresponding to the IDL implementations:
154   INCLUDE(${PROJECT_SOURCE_DIR}/src/VTKWrapping/wrap.cmake)
155
156   ## From 2.8.10, we should use:
157   ## SET(CMAKE_POSITION_INDEPENDENT_CODE ON)
158   SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC")
159
160   # Make the list of wrapped files visible from the top directory (will be used in idl):
161   SET(WRAP_IDL_I_HH "${WRAP_IDL_I_HH}" PARENT_SCOPE)
162   SET(WRAP_IDL_I_CC "${WRAP_IDL_I_CC}" PARENT_SCOPE)
163
164   SET(_VTK_wrap_SOURCES
165     PARAVIS_CreateClass.cxx
166     ${WRAP_IDL_I_CC}
167   )
168 ENDIF()
169   
170 # sources / to compile
171 SET(PVGUI_SOURCES 
172   ${_other_SOURCES} 
173   ${_moc_SOURCES} 
174   ${_rcc_SOURCES} 
175 #  ${vtkEDFCutter_SRCS} 
176   ${_VTK_wrap_SOURCES}
177   ${_ui_FORMS_HEADERS}
178   )
179
180 # --- rules ---
181
182 IF(NOT SALOME_PARAVIS_MINIMAL_CORBA)
183   ADD_CUSTOM_COMMAND(
184    OUTPUT PARAVIS_CreateClass.cxx
185     COMMAND ${PYTHON_EXECUTABLE} ${PROJECT_SOURCE_DIR}/src/VTKWrapping/create_class.py ${CMAKE_BINARY_DIR}
186     DEPENDS ${CMAKE_BINARY_DIR}/wrapfiles.txt 
187          ${PROJECT_BINARY_DIR}/idl/PARAVIS_Gen.hh 
188          ${PROJECT_BINARY_DIR}/idl/PARAVIS_Gen_Types.hh
189          SalomeIDLPARAVIS
190          generate_implements
191   )
192
193   # All wrapping tools have to be build before generating the above module - NEEDED?
194   ###ADD_DEPENDENCIES(SalomeIDLPARAVIS vtkWrapIDL_HH vtkWrapIDL_CC vtkWrapIDL)
195
196   # Intermediate target used in PVGUI directory (we can not cross reference
197   # a generated source file across directories, hence this trick):
198   INCLUDE_DIRECTORIES(
199     ${PROJECT_BINARY_DIR}/idl
200     ${PROJECT_BINARY_DIR}/src/VTKWrapping
201   )
202 ENDIF()
203
204 ADD_LIBRARY(PARAVIS ${PVGUI_SOURCES})
205 IF(NOT SALOME_PARAVIS_MINIMAL_CORBA)
206   # Make sure the generation of the VTK wrapping get executed first:
207   ADD_DEPENDENCIES(PARAVIS PARAVIS_CreateClass.cxx)
208 ENDIF()
209
210 IF(NOT SALOME_PARAVIS_MINIMAL_CORBA)
211   # Ensure .hh files corresponding to IDL have been generated first:
212   ADD_DEPENDENCIES(PARAVIS omniorb_module_SalomeIDLPARAVIS)  
213 ENDIF()
214
215 TARGET_LINK_LIBRARIES(PARAVIS ${_link_LIBRARIES})
216 INSTALL(TARGETS PARAVIS EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_LIBS})
217
218
219 # --- header and resources installation ---
220 INSTALL(FILES ${PVGUI_HEADERS} DESTINATION ${SALOME_INSTALL_HEADERS})
221 QT4_INSTALL_TS_RESOURCES("${_ts_RESOURCES}" "${SALOME_PARAVIS_INSTALL_RES_DATA}")
222 INSTALL(FILES ${_other_RESOURCES} DESTINATION ${SALOME_PARAVIS_INSTALL_RES_DATA})