Salome HOME
Turning PARAVIS into a Light module
[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_BINARY_DIR}
34     )
35
36 # additional preprocessor / compiler flags
37 ADD_DEFINITIONS(${CAS_DEFINITIONS})
38 ADD_DEFINITIONS(${OMNIORB_DEFINITIONS})
39 ADD_DEFINITIONS(${KERNEL_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   ${PYTHON_LIBS}
50   ${KERNEL_LDFLAGS}
51   ${GUI_LDFLAGS} ${GUI_LightApp} ${GUI_CAM} ${GUI_qtx} ${GUI_suit}
52                  ${GUI_SalomeObject} ${GUI_vtkTools}
53   ${_PARAVIEW_APP_COMPO_LIB}
54   ${GUI_PVViewer}
55 )
56
57 # --- headers ---
58
59 SET(_ui_files
60     resources/pqCustomSettingsWidget.ui
61     )
62
63 QT4_WRAP_UI(_ui_FORMS_HEADERS ${_ui_files})
64
65 # header files / to be processed by moc
66 SET(_moc_HEADERS
67   PVGUI_Module.h
68   PVGUI_DataModel.h
69   PVGUI_ParaViewSettingsPane.h
70 )
71
72 # header files / to install
73 SET(PVGUI_HEADERS ${_moc_HEADERS} ${_ui_FORMS_HEADERS})
74
75 # --- resources ---
76
77 # resource files / to be processed by lrelease
78 SET(_ts_RESOURCES
79   resources/PARAVIS_images.ts
80   resources/PARAVIS_msg_en.ts
81   resources/PARAVIS_msg_fr.ts
82   resources/PARAVIS_msg_ja.ts
83 )
84
85 # resource files / static
86 SET(_other_RESOURCES
87   # sampleservers.pvsc ???
88 )
89
90 IF(SALOME_BUILD_DOC)
91   # --- ParaView documentation is built as a resource ---
92   # Check ParaView documentation file existence
93   # if it exists add it to the resources (compile into binary form)
94   # otherwise print warning message
95   SET(PV_DOC_FILE ${VTK_INSTALL_PREFIX}/share/doc/paraview-${PARAVIEW_VERSION_MAJOR}.${PARAVIEW_VERSION_MINOR}/paraview.qch)
96   IF (EXISTS ${PV_DOC_FILE})
97     SET(RC_SOURCE ${CMAKE_CURRENT_SOURCE_DIR}/PVGUI.qrc.in)
98     SET(RC_GENERATED ${CMAKE_CURRENT_BINARY_DIR}/PVGUI.qrc)
99     MESSAGE(STATUS "Creation of ${RC_GENERATED}")
100     CONFIGURE_FILE(${RC_SOURCE} ${RC_GENERATED})
101     SET(_rcc_RESOURCES ${RC_GENERATED})
102     ADD_DEFINITIONS(-DHAS_PV_DOC)
103   ELSE ()
104     MESSAGE(WARNING "Help file for ParaView has not been found! ParaView documentation will not be available.")
105   ENDIF ()
106 ENDIF()
107
108 # --- sources ---
109
110 # sources / rcc wrappings
111 QT4_ADD_RESOURCES(_rcc_SOURCES ${_rcc_RESOURCES})
112
113 # sources / moc wrappings
114 QT4_WRAP_CPP(_moc_SOURCES ${_moc_HEADERS})
115
116 # sources / static
117 SET(_other_SOURCES
118   PVGUI_Module.cxx
119   PVGUI_Module_actions.cxx
120   PVGUI_Module_widgets.cxx
121   PVGUI_ParaViewSettingsPane.cxx
122   PVGUI_DataModel.cxx
123   )
124
125 # sources / to compile
126 SET(PVGUI_SOURCES 
127   ${_other_SOURCES} 
128   ${_moc_SOURCES} 
129   ${_rcc_SOURCES} 
130   ${_VTK_wrap_SOURCES}
131   ${_ui_FORMS_HEADERS}
132   )
133
134 # --- rules ---
135 ADD_LIBRARY(PARAVIS ${PVGUI_SOURCES})
136 TARGET_LINK_LIBRARIES(PARAVIS ${_link_LIBRARIES})
137 INSTALL(TARGETS PARAVIS EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_LIBS})
138
139 # --- header and resources installation ---
140 INSTALL(FILES ${PVGUI_HEADERS} DESTINATION ${SALOME_INSTALL_HEADERS})
141 QT4_INSTALL_TS_RESOURCES("${_ts_RESOURCES}" "${SALOME_PARAVIS_INSTALL_RES_DATA}")
142 INSTALL(FILES ${_other_RESOURCES} DESTINATION ${SALOME_PARAVIS_INSTALL_RES_DATA})