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