Salome HOME
Removed unecessary link to GUI_Events.
[modules/paravis.git] / src / PVGUI / CMakeLists.txt
1 # Copyright (C) 2010-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(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_SOURCE_DIR}/view
34     ${CMAKE_CURRENT_BINARY_DIR}
35     )
36
37 # additional preprocessor / compiler flags
38 ADD_DEFINITIONS(${CAS_DEFINITIONS})
39 ADD_DEFINITIONS(${OMNIORB_DEFINITIONS})
40 ADD_DEFINITIONS(${KERNEL_DEFINITIONS})
41
42 # libraries to link to
43 SET(_PARAVIEW_APP_COMPO_LIB
44   pqApplicationComponents
45   )
46
47 SET(_link_LIBRARIES 
48   ${OMNIORB_LIBRARIES}
49   ${QT_LIBRARIES}
50   ${PYTHON_LIBS}
51   ${KERNEL_LDFLAGS} ${KERNEL_SalomeDS}
52   ${GUI_LDFLAGS} ${GUI_SalomeApp} ${GUI_LightApp} ${GUI_CAM} ${GUI_qtx} ${GUI_suit}   
53                  ${GUI_SalomeObject} ${GUI_vtkTools}
54   ${MED_SalomeIDLMED}
55   ${_PARAVIEW_APP_COMPO_LIB}
56   ${GUI_PVViewer}
57   SalomeIDLPVServer
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_DataModel.h
72   PVGUI_ParaViewSettingsPane.h
73 )
74
75 # header files / no moc processing
76 SET(_other_HEADERS
77   PVGUI_Tools.h
78 )
79
80 # header files / to install
81 SET(PVGUI_HEADERS ${_moc_HEADERS} ${_other_HEADERS} ${_ui_FORMS_HEADERS})
82
83 # --- resources ---
84
85 # resource files / to be processed by lrelease
86 SET(_ts_RESOURCES
87   resources/PARAVIS_images.ts
88   resources/PARAVIS_msg_en.ts
89   resources/PARAVIS_msg_fr.ts
90   resources/PARAVIS_msg_ja.ts
91 )
92
93 # resource files / static
94 SET(_other_RESOURCES
95   # sampleservers.pvsc ???
96 )
97
98 IF(SALOME_BUILD_DOC)
99   # --- ParaView documentation is built as a resource ---
100   # Check ParaView documentation file existence
101   # if it exists add it to the resources (compile into binary form)
102   # otherwise print warning message
103   SET(PV_DOC_FILE ${VTK_INSTALL_PREFIX}/share/doc/paraview-${PARAVIEW_VERSION_MAJOR}.${PARAVIEW_VERSION_MINOR}/paraview.qch)
104   IF (EXISTS ${PV_DOC_FILE})
105     SET(RC_SOURCE ${CMAKE_CURRENT_SOURCE_DIR}/PVGUI.qrc.in)
106     SET(RC_GENERATED ${CMAKE_CURRENT_BINARY_DIR}/PVGUI.qrc)
107     MESSAGE(STATUS "Creation of ${RC_GENERATED}")
108     CONFIGURE_FILE(${RC_SOURCE} ${RC_GENERATED})
109     SET(_rcc_RESOURCES ${RC_GENERATED})
110     ADD_DEFINITIONS(-DHAS_PV_DOC)
111   ELSE ()
112     MESSAGE(WARNING "Help file for ParaView has not been found! ParaView documentation will not be available.")
113   ENDIF ()
114 ENDIF()
115
116 # --- sources ---
117
118 # sources / rcc wrappings
119 QT4_ADD_RESOURCES(_rcc_SOURCES ${_rcc_RESOURCES})
120
121 # sources / moc wrappings
122 QT4_WRAP_CPP(_moc_SOURCES ${_moc_HEADERS})
123
124 # sources / static
125 SET(_other_SOURCES
126   PVGUI_Module.cxx
127   PVGUI_Module_actions.cxx
128   PVGUI_Module_widgets.cxx
129   PVGUI_Tools.cxx
130   PVGUI_ParaViewSettingsPane.cxx
131   PVGUI_DataModel.cxx
132   )
133
134 # sources / to compile
135 SET(PVGUI_SOURCES 
136   ${_other_SOURCES} 
137   ${_moc_SOURCES} 
138   ${_rcc_SOURCES} 
139   ${_VTK_wrap_SOURCES}
140   ${_ui_FORMS_HEADERS}
141   )
142
143 # --- rules ---
144 ADD_LIBRARY(PARAVIS ${PVGUI_SOURCES})
145 TARGET_LINK_LIBRARIES(PARAVIS ${_link_LIBRARIES})
146 INSTALL(TARGETS PARAVIS EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_LIBS})
147
148 # --- header and resources installation ---
149 INSTALL(FILES ${PVGUI_HEADERS} DESTINATION ${SALOME_INSTALL_HEADERS})
150 QT4_INSTALL_TS_RESOURCES("${_ts_RESOURCES}" "${SALOME_PARAVIS_INSTALL_RES_DATA}")
151 INSTALL(FILES ${_other_RESOURCES} DESTINATION ${SALOME_PARAVIS_INSTALL_RES_DATA})