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