Salome HOME
Merge remote branch 'origin/V7_dev'
[modules/paravis.git] / src / PVGUI / CMakeLists.txt
1 # Copyright (C) 2010-2016  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(UseQtExt)
21
22 # --- options ---
23
24 INCLUDE_DIRECTORIES(
25     ${KERNEL_INCLUDE_DIRS}
26     ${GUI_INCLUDE_DIRS}  
27     ${PROJECT_BINARY_DIR} 
28     ${CAS_INCLUDE_DIRS} 
29     ${Boost_INCLUDE_DIRS}
30     ${QT_INCLUDES}
31     ${CMAKE_CURRENT_SOURCE_DIR}
32     ${CMAKE_CURRENT_BINARY_DIR}
33     )
34
35 # additional preprocessor / compiler flags
36 ADD_DEFINITIONS(${CAS_DEFINITIONS})
37 ADD_DEFINITIONS(${KERNEL_DEFINITIONS})
38
39 # libraries to link to
40 SET(_PARAVIEW_APP_COMPO_LIB
41   pqApplicationComponents
42   )
43
44 SET(_link_LIBRARIES 
45   ${QT_LIBRARIES}
46   ${PYTHON_LIBS}
47   ${KERNEL_LDFLAGS}
48   ${GUI_LDFLAGS} ${GUI_LightApp} ${GUI_CAM} ${GUI_qtx} ${GUI_suit}
49                  ${GUI_SalomeObject}
50   ${_PARAVIEW_APP_COMPO_LIB}
51   ${GUI_PVViewer}
52 )
53
54 # --- headers ---
55
56 SET(_ui_files
57     resources/pqCustomSettingsWidget.ui
58     )
59
60 QT_WRAP_UIC(_ui_FORMS_HEADERS ${_ui_files})
61
62 # header files / to be processed by moc
63 SET(_moc_HEADERS
64   PVGUI_Module.h
65   PVGUI_DataModel.h
66   PVGUI_ParaViewSettingsPane.h
67 )
68
69 # header files / to install
70 SET(PVGUI_HEADERS ${_moc_HEADERS} ${_ui_FORMS_HEADERS})
71
72 # --- resources ---
73
74 # resource files / to be processed by lrelease
75 SET(_ts_RESOURCES
76   resources/PARAVIS_images.ts
77   resources/PARAVIS_msg_en.ts
78   resources/PARAVIS_msg_fr.ts
79   resources/PARAVIS_msg_ja.ts
80 )
81
82 # resource files / static
83 SET(_other_RESOURCES
84   # sampleservers.pvsc ???
85 )
86
87 IF(SALOME_BUILD_DOC)
88   # --- ParaView documentation is built as a resource ---
89   # Check ParaView documentation file existence
90   # if it exists add it to the resources (compile into binary form)
91   # otherwise print warning message
92   SET(PV_DOC_FILE ${VTK_INSTALL_PREFIX}/share/doc/paraview-${PARAVIEW_VERSION_MAJOR}.${PARAVIEW_VERSION_MINOR}/paraview.qch)
93   IF (EXISTS ${PV_DOC_FILE})
94     SET(RC_SOURCE ${CMAKE_CURRENT_SOURCE_DIR}/PVGUI.qrc.in)
95     SET(RC_GENERATED ${CMAKE_CURRENT_BINARY_DIR}/PVGUI.qrc)
96     MESSAGE(STATUS "Creation of ${RC_GENERATED}")
97     CONFIGURE_FILE(${RC_SOURCE} ${RC_GENERATED})
98     SET(_rcc_RESOURCES ${RC_GENERATED})
99     ADD_DEFINITIONS(-DHAS_PV_DOC)
100   ELSE ()
101     MESSAGE(WARNING "Help file for ParaView has not been found! ParaView documentation will not be available.")
102   ENDIF ()
103 ENDIF()
104
105 # --- sources ---
106
107 # sources / rcc wrappings
108 QT_ADD_RESOURCES(_rcc_SOURCES ${_rcc_RESOURCES})
109
110 # sources / moc wrappings
111 QT_WRAP_MOC(_moc_SOURCES ${_moc_HEADERS})
112
113 # sources / static
114 SET(_other_SOURCES
115   PVGUI_Module.cxx
116   PVGUI_Module_actions.cxx
117   PVGUI_Module_widgets.cxx
118   PVGUI_ParaViewSettingsPane.cxx
119   PVGUI_DataModel.cxx
120   )
121
122 # sources / to compile
123 SET(PVGUI_SOURCES 
124   ${_other_SOURCES} 
125   ${_moc_SOURCES} 
126   ${_rcc_SOURCES} 
127   ${_VTK_wrap_SOURCES}
128   ${_ui_FORMS_HEADERS}
129   )
130
131 # --- rules ---
132 ADD_LIBRARY(PARAVIS ${PVGUI_SOURCES})
133 TARGET_LINK_LIBRARIES(PARAVIS ${_link_LIBRARIES})
134 INSTALL(TARGETS PARAVIS EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_LIBS})
135
136 # --- header and resources installation ---
137 INSTALL(FILES ${PVGUI_HEADERS} DESTINATION ${SALOME_INSTALL_HEADERS})
138 QT_INSTALL_TS_RESOURCES("${_ts_RESOURCES}" "${SALOME_PARAVIS_INSTALL_RES_DATA}")
139 INSTALL(FILES ${_other_RESOURCES} DESTINATION ${SALOME_PARAVIS_INSTALL_RES_DATA})