]> SALOME platform Git repositories - modules/shaper.git/blob - src/XGUI/CMakeLists.txt
Salome HOME
Merge commit '9b79b986a894aff7ede04c8e43609842e5a9401b'
[modules/shaper.git] / src / XGUI / CMakeLists.txt
1 # Copyright (C) 2014-2023  CEA, EDF
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 # additional include directories
23 INCLUDE_DIRECTORIES(${QT_INCLUDES})
24
25 # additional preprocessor / compiler flags
26 ADD_DEFINITIONS(${QT_DEFINITIONS})
27
28 SET(UPDATE_TRANSLATION OFF)
29
30
31
32 SET(PROJECT_HEADERS
33     XGUI.h
34     XGUI_ActionsMgr.h
35     XGUI_ActiveControlMgr.h
36     XGUI_ActiveControlSelector.h
37     XGUI_ColorDialog.h
38     XGUI_ContextMenuMgr.h
39     XGUI_DataModel.h
40     XGUI_DeflectionDialog.h
41     XGUI_Displayer.h
42     XGUI_ErrorDialog.h
43     XGUI_ErrorMgr.h
44     XGUI_FacesPanel.h
45     XGUI_FacesPanelSelector.h
46     XGUI_HistoryMenu.h
47     XGUI_MenuGroup.h
48     XGUI_MenuMgr.h
49     XGUI_MenuWorkbench.h
50     XGUI_ModuleConnector.h
51     XGUI_ObjectsBrowser.h
52     XGUI_OperationMgr.h
53     XGUI_PropertyDialog.h
54     XGUI_PropertyPanel.h
55     XGUI_PropertyPanelSelector.h
56     XGUI_QtEvents.h
57     XGUI_SalomeConnector.h
58     XGUI_Selection.h
59     XGUI_SelectionActivate.h
60     XGUI_SelectionMgr.h
61     XGUI_Tools.h
62     XGUI_TransparencyWidget.h
63     XGUI_ViewerProxy.h
64     XGUI_Workshop.h
65     XGUI_WorkshopListener.h
66         XGUI_InspectionPanel.h
67         XGUI_CompressFiles.h
68 )
69
70 SET(PROJECT_MOC_HEADERS
71     XGUI_ActionsMgr.h
72     XGUI_ActiveControlMgr.h
73     XGUI_ActiveControlSelector.h
74     XGUI_ColorDialog.h
75     XGUI_ContextMenuMgr.h
76     XGUI_DataModel.h
77     XGUI_DeflectionDialog.h
78     XGUI_Displayer.h
79     XGUI_ErrorDialog.h
80     XGUI_ErrorMgr.h
81     XGUI_FacesPanel.h
82     XGUI_FacesPanelSelector.h
83     XGUI_HistoryMenu.h
84     XGUI_ModuleConnector.h
85     XGUI_ObjectsBrowser.h
86     XGUI_OperationMgr.h
87     XGUI_PropertyDialog.h
88     XGUI_PropertyPanel.h
89     XGUI_PropertyPanelSelector.h
90     XGUI_SelectionMgr.h
91     XGUI_TransparencyWidget.h
92     XGUI_ViewerProxy.h
93     XGUI_Workshop.h
94     XGUI_WorkshopListener.h
95         XGUI_InspectionPanel.h
96 )
97
98 # sources / moc wrappings
99 QT_WRAP_MOC(PROJECT_AUTOMOC ${PROJECT_MOC_HEADERS})
100
101 SET(PROJECT_SOURCES
102     XGUI_ActionsMgr.cpp
103     XGUI_ActiveControlMgr.cpp
104     XGUI_ColorDialog.cpp
105     XGUI_ContextMenuMgr.cpp
106     XGUI_DataModel.cpp
107     XGUI_DeflectionDialog.cpp
108     XGUI_Displayer.cpp
109     XGUI_ErrorDialog.cpp
110     XGUI_ErrorMgr.cpp
111     XGUI_FacesPanel.cpp
112     XGUI_FacesPanelSelector.cpp
113     XGUI_HistoryMenu.cpp
114     XGUI_MenuGroup.cpp
115     XGUI_MenuMgr.cpp
116     XGUI_MenuWorkbench.cpp
117     XGUI_ModuleConnector.cpp
118     XGUI_ObjectsBrowser.cpp
119     XGUI_OperationMgr.cpp
120     XGUI_PropertyDialog.cpp
121     XGUI_PropertyPanel.cpp
122     XGUI_PropertyPanelSelector.cpp
123     XGUI_QtEvents.cpp
124     XGUI_SalomeConnector.cpp
125     XGUI_Selection.cpp
126     XGUI_SelectionActivate.cpp
127     XGUI_SelectionMgr.cpp
128     XGUI_Tools.cpp
129     XGUI_TransparencyWidget.cpp
130     XGUI_ViewerProxy.cpp
131     XGUI_Workshop.cpp
132     XGUI_WorkshopListener.cpp
133         XGUI_InspectionPanel.cpp
134         XGUI_CompressFiles.cpp
135 )
136
137 SET(PROJECT_RESOURCES
138     XGUI_pictures.qrc
139 )
140
141 SET(PREFERENCES_XML
142     SHAPER.xml
143 )
144
145 SET(TEXT_RESOURCES
146     XGUI_msg_fr.ts
147 )
148
149 SET(PROJECT_LIBRARIES
150     Events
151     Config
152     ModelAPI
153     ModuleBase
154     ${QT_LIBRARIES}
155     ${OpenCASCADE_FoundationClasses_LIBRARIES}
156     ${OpenCASCADE_Visualization_LIBRARIES}
157     ${PYTHON_LIBRARIES}
158     ${PyConsole}
159     ${PyInterp}
160     ${suit}
161     ${qtx}
162 )
163
164 IF(NOT ${HAVE_SALOME})
165     SET(PROJECT_LIBRARIES ${PROJECT_LIBRARIES} AppElements)
166 ENDIF(NOT ${HAVE_SALOME})
167
168
169 IF(WIN32)
170     SET(PROJECT_LIBRARIES ${PROJECT_LIBRARIES} opengl32)
171 ELSE()
172     SET(PROJECT_LIBRARIES ${PROJECT_LIBRARIES} GL)
173 ENDIF()
174
175 QT_ADD_RESOURCES(PROJECT_COMPILED_RESOURCES ${PROJECT_RESOURCES})
176
177
178
179 IF (${UPDATE_TRANSLATION})
180     SET(PROJECT_FILES ${PROJECT_SOURCES} ${PROJECT_HEADERS} )
181     QT5_CREATE_TRANSLATION(QM_RESOURCES
182                            ${PROJECT_FILES}
183                            ${TEXT_RESOURCES}
184                            OPTIONS -extensions cpp -no-recursive -locations none
185                           )
186 ELSE(${UPDATE_TRANSLATION})
187     IF(${MAKE_TRANSLATION})
188         QT5_ADD_TRANSLATION(QM_RESOURCES ${TEXT_RESOURCES})
189     ENDIF(${MAKE_TRANSLATION})
190 ENDIF(${UPDATE_TRANSLATION})
191
192
193 SOURCE_GROUP ("Generated Files" FILES ${PROJECT_AUTOMOC} ${PROJECT_COMPILED_RESOURCES} ${QM_RESOURCES})
194 #SOURCE_GROUP ("Generated Files" FILES ${PROJECT_AUTOMOC} ${PROJECT_COMPILED_RESOURCES})
195 SOURCE_GROUP ("Resource Files" FILES ${TEXT_RESOURCES} ${PROJECT_RESOURCES} ${PREFERENCES_XML})
196
197 ADD_DEFINITIONS( -DXGUI_EXPORTS ${OpenCASCADE_DEFINITIONS} -D_CRT_SECURE_NO_WARNINGS)
198
199 SET(PROJECT_INCLUDES
200     ${PROJECT_SOURCE_DIR}/src/Events
201     ${PROJECT_SOURCE_DIR}/src/Config
202     ${PROJECT_SOURCE_DIR}/src/ExchangePlugin
203     ${PROJECT_SOURCE_DIR}/src/ModelAPI
204     ${PROJECT_SOURCE_DIR}/src/GeomAPI
205     ${PROJECT_SOURCE_DIR}/src/ModuleBase
206     ${PROJECT_SOURCE_DIR}/src/GeomAlgoAPI
207     ${PROJECT_SOURCE_DIR}/src/Model
208     ${OpenCASCADE_INCLUDE_DIR}
209     ${SUIT_INCLUDE})
210
211 IF(NOT ${HAVE_SALOME})
212     SET(PROJECT_INCLUDES ${PROJECT_INCLUDES} ${APPELEMENTS_INCLUDE_DIR})
213 ENDIF(NOT ${HAVE_SALOME})
214
215 IF(TKTInspector)
216     message("TINSPECTOR is defined")
217     SET(PROJECT_LIBRARIES ${PROJECT_LIBRARIES} ${TKTInspectorAPI} ${TKTInspector} ${TKTreeModel} ${TKVInspector})
218     SET(PROJECT_INCLUDES ${PROJECT_INCLUDES} ${TINSPECTOR_INCLUDE_DIR})
219
220     ADD_DEFINITIONS(-DTINSPECTOR)
221 ENDIF()
222
223 INCLUDE_DIRECTORIES(${PROJECT_INCLUDES})
224
225 LINK_DIRECTORIES($ENV{PYTHON_LIB_DIR})
226
227 ADD_LIBRARY(XGUI SHARED
228     ${PROJECT_SOURCES}
229     ${PROJECT_HEADERS}
230     ${PROJECT_COMPILED_RESOURCES}
231     ${TEXT_RESOURCES}
232     ${QM_RESOURCES}
233     ${PREFERENCES_XML}
234     ${PROJECT_AUTOMOC}
235 )
236
237 ADD_DEPENDENCIES(XGUI ModelAPI)
238
239 # The Qt5Widgets_LIBRARIES variable also includes QtGui and QtCore
240 TARGET_LINK_LIBRARIES(XGUI ${PROJECT_LIBRARIES})
241
242 INSTALL(TARGETS XGUI DESTINATION ${SHAPER_INSTALL_BIN})
243 INSTALL(FILES ${QM_RESOURCES} DESTINATION ${SHAPER_INSTALL_QM_RESOURCES})
244 INSTALL(FILES ${PREFERENCES_XML} DESTINATION ${SHAPER_INSTALL_RESOURCES})
245 INSTALL(DIRECTORY icons/ DESTINATION ${SHAPER_INSTALL_RESOURCES})