1 # Copyright (C) 2010-2014 CEA/DEN, EDF R&D
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
24 INCLUDE_DIRECTORIES(${OMNIORB_INCLUDE_DIR}
25 ${KERNEL_INCLUDE_DIRS}
27 ${PROJECT_BINARY_DIR}/idl
32 ${CMAKE_CURRENT_SOURCE_DIR}
33 ${CMAKE_CURRENT_SOURCE_DIR}/view
34 ${CMAKE_CURRENT_BINARY_DIR}
38 #ADD_SUBDIRECTORY(view)
40 # additional preprocessor / compiler flags
41 ADD_DEFINITIONS(${CAS_DEFINITIONS})
42 ADD_DEFINITIONS(${OMNIORB_DEFINITIONS})
43 ADD_DEFINITIONS(${KERNEL_DEFINITIONS})
45 # libraries to link to
46 SET(_PARAVIEW_APP_COMPO_LIB
47 pqApplicationComponents
55 ${GUI_LDFLAGS} ${GUI_SalomeApp} ${GUI_LightApp} ${GUI_CAM} ${GUI_qtx} ${GUI_suit} ${GUI_Event}
56 ${GUI_SalomeObject} ${GUI_vtkTools}
58 ${_PARAVIEW_APP_COMPO_LIB}
66 resources/pqCustomSettingsWidget.ui
69 QT4_WRAP_UI(_ui_FORMS_HEADERS ${_ui_files})
71 # header files / to be processed by moc
75 PVGUI_ParaViewSettingsPane.h
78 # header files / no moc processing
80 # PVGUI_OutputWindowAdapter.h
87 IF(NOT SALOME_PARAVIS_MINIMAL_CORBA)
88 LIST(APPEND _other_HEADERS PV_Tools.h)
91 # header files / to install
92 SET(PVGUI_HEADERS ${_moc_HEADERS} ${_other_HEADERS} ${_ui_FORMS_HEADERS})
96 # resource files / to be processed by lrelease
98 resources/PARAVIS_images.ts
99 resources/PARAVIS_msg_en.ts
100 resources/PARAVIS_msg_fr.ts
101 resources/PARAVIS_msg_ja.ts
104 # resource files / static
106 # sampleservers.pvsc ???
110 # --- ParaView documentation is built as a resource ---
111 # Check ParaView documentation file existence
112 # if it exists add it to the resources (compile into binary form)
113 # otherwise print warning message
114 SET(PV_DOC_FILE ${VTK_INSTALL_PREFIX}/share/doc/paraview-${PARAVIEW_VERSION_MAJOR}.${PARAVIEW_VERSION_MINOR}/paraview.qch)
115 IF (EXISTS ${PV_DOC_FILE})
116 SET(RC_SOURCE ${CMAKE_CURRENT_SOURCE_DIR}/PVGUI.qrc.in)
117 SET(RC_GENERATED ${CMAKE_CURRENT_BINARY_DIR}/PVGUI.qrc)
118 MESSAGE(STATUS "Creation of ${RC_GENERATED}")
119 CONFIGURE_FILE(${RC_SOURCE} ${RC_GENERATED})
120 SET(_rcc_RESOURCES ${RC_GENERATED})
121 ADD_DEFINITIONS(-DHAS_PV_DOC)
123 MESSAGE(WARNING "Help file for ParaView has not been found! ParaView documentation will not be available.")
129 # sources / rcc wrappings
130 QT4_ADD_RESOURCES(_rcc_SOURCES ${_rcc_RESOURCES})
132 # sources / moc wrappings
133 QT4_WRAP_CPP(_moc_SOURCES ${_moc_HEADERS})
135 # sources / EDF specific stuff
136 #INCLUDE(vtkWrapClientServer)
137 #VTK_WRAP_ClientServer(vtkEDFCutterCS vtkEDFCutter_SRCS ${GUI_ROOT_DIR}/include/salome/vtkEDFCutter.h)
142 PVGUI_Module_actions.cxx
143 PVGUI_Module_widgets.cxx
145 PVGUI_ParaViewSettingsPane.cxx
149 IF(NOT SALOME_PARAVIS_MINIMAL_CORBA)
150 # Generate headers and sources corresponding to the IDL implementations:
151 INCLUDE(${PROJECT_SOURCE_DIR}/src/VTKWrapping/wrap.cmake)
153 ## From 2.8.10, we should use:
154 ## SET(CMAKE_POSITION_INDEPENDENT_CODE ON)
155 SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC")
157 # Make the list of wrapped files visible from the top directory (will be used in idl):
158 SET(WRAP_IDL_I_HH "${WRAP_IDL_I_HH}" PARENT_SCOPE)
159 SET(WRAP_IDL_I_CC "${WRAP_IDL_I_CC}" PARENT_SCOPE)
161 SET(_VTK_wrap_SOURCES
163 PARAVIS_CreateClass.cxx
168 # sources / to compile
173 # ${vtkEDFCutter_SRCS}
180 IF(NOT SALOME_PARAVIS_MINIMAL_CORBA)
182 OUTPUT PARAVIS_CreateClass.cxx
183 COMMAND ${PYTHON_EXECUTABLE} ${PROJECT_SOURCE_DIR}/src/VTKWrapping/create_class.py ${CMAKE_BINARY_DIR}
184 DEPENDS ${CMAKE_BINARY_DIR}/wrapfiles.txt
185 ${PROJECT_BINARY_DIR}/idl/PARAVIS_Gen.hh
186 ${PROJECT_BINARY_DIR}/idl/PARAVIS_Gen_Types.hh
191 # All wrapping tools have to be build before generating the above module - NEEDED?
192 ###ADD_DEPENDENCIES(SalomeIDLPARAVIS vtkWrapIDL_HH vtkWrapIDL_CC vtkWrapIDL)
194 # Intermediate target used in PVGUI directory (we can not cross reference
195 # a generated source file across directories, hence this trick):
197 ${PROJECT_BINARY_DIR}/idl
198 ${PROJECT_BINARY_DIR}/src/VTKWrapping
202 ADD_LIBRARY(PARAVIS ${PVGUI_SOURCES})
203 IF(NOT SALOME_PARAVIS_MINIMAL_CORBA)
204 # Make sure the generation of the VTK wrapping get executed first:
205 ADD_DEPENDENCIES(PARAVIS PARAVIS_CreateClass.cxx)
208 IF(NOT SALOME_PARAVIS_MINIMAL_CORBA)
209 # Ensure .hh files corresponding to IDL have been generated first:
210 ADD_DEPENDENCIES(PARAVIS omniorb_module_SalomeIDLPARAVIS)
213 TARGET_LINK_LIBRARIES(PARAVIS ${_link_LIBRARIES})
214 INSTALL(TARGETS PARAVIS EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_LIBS})
217 # --- header and resources installation ---
218 INSTALL(FILES ${PVGUI_HEADERS} DESTINATION ${SALOME_INSTALL_HEADERS})
219 QT4_INSTALL_TS_RESOURCES("${_ts_RESOURCES}" "${SALOME_PARAVIS_INSTALL_RES_DATA}")
220 INSTALL(FILES ${_other_RESOURCES} DESTINATION ${SALOME_PARAVIS_INSTALL_RES_DATA})