]> SALOME platform Git repositories - modules/shaper.git/blob - src/XGUI/CMakeLists.txt
Salome HOME
1bc373d68798e5fb488e122c1bef4ce13db68f87
[modules/shaper.git] / src / XGUI / CMakeLists.txt
1 ## Copyright (C) 2014-2017  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
18 ## email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
19 ##
20
21 INCLUDE(UseQtExt)
22
23 # additional include directories
24 INCLUDE_DIRECTORIES(${QT_INCLUDES})
25
26 # additional preprocessor / compiler flags
27 ADD_DEFINITIONS(${QT_DEFINITIONS})
28
29 SET(PROJECT_HEADERS
30     XGUI.h
31     XGUI_ActionsMgr.h
32     XGUI_ColorDialog.h
33     XGUI_ContextMenuMgr.h
34     XGUI_CustomPrs.h
35     XGUI_DataModel.h
36     XGUI_DeflectionDialog.h
37     XGUI_Displayer.h
38     XGUI_ErrorDialog.h
39     XGUI_ErrorMgr.h
40     XGUI_HistoryMenu.h
41     XGUI_MenuGroup.h
42     XGUI_MenuMgr.h
43     XGUI_MenuWorkbench.h
44     XGUI_ModuleConnector.h
45     XGUI_ObjectsBrowser.h
46     XGUI_OperationMgr.h
47     XGUI_PropertyPanel.h
48     XGUI_QtEvents.h
49     XGUI_SalomeConnector.h
50     XGUI_Selection.h
51     XGUI_SelectionMgr.h
52     XGUI_Tools.h
53     XGUI_ViewerProxy.h
54     XGUI_Workshop.h
55     XGUI_WorkshopListener.h
56 )
57
58 SET(PROJECT_MOC_HEADERS
59     XGUI_ActionsMgr.h
60     XGUI_ColorDialog.h
61     XGUI_ContextMenuMgr.h
62     XGUI_DataModel.h
63     XGUI_DeflectionDialog.h
64     XGUI_Displayer.h
65     XGUI_ErrorDialog.h
66     XGUI_ErrorMgr.h
67     XGUI_HistoryMenu.h
68     XGUI_ModuleConnector.h
69     XGUI_ObjectsBrowser.h
70     XGUI_OperationMgr.h
71     XGUI_PropertyPanel.h
72     XGUI_SelectionMgr.h
73     XGUI_ViewerProxy.h
74     XGUI_Workshop.h
75     XGUI_WorkshopListener.h
76 )
77
78 # sources / moc wrappings
79 QT_WRAP_MOC(PROJECT_AUTOMOC ${PROJECT_MOC_HEADERS})
80
81 SET(PROJECT_SOURCES
82     XGUI_ActionsMgr.cpp
83     XGUI_ColorDialog.cpp
84     XGUI_ContextMenuMgr.cpp
85     XGUI_CustomPrs.cpp
86     XGUI_DataModel.cpp
87     XGUI_DeflectionDialog.cpp
88     XGUI_Displayer.cpp
89     XGUI_ErrorDialog.cpp
90     XGUI_ErrorMgr.cpp
91     XGUI_HistoryMenu.cpp
92     XGUI_MenuGroup.cpp
93     XGUI_MenuMgr.cpp
94     XGUI_MenuWorkbench.cpp
95     XGUI_ModuleConnector.cpp
96     XGUI_ObjectsBrowser.cpp
97     XGUI_OperationMgr.cpp
98     XGUI_PropertyPanel.cpp
99     XGUI_QtEvents.cpp
100     XGUI_SalomeConnector.cpp
101     XGUI_Selection.cpp
102     XGUI_SelectionMgr.cpp
103     XGUI_Tools.cpp
104     XGUI_ViewerProxy.cpp
105     XGUI_Workshop.cpp
106     XGUI_WorkshopListener.cpp
107 )
108
109 SET(PROJECT_RESOURCES
110     XGUI_pictures.qrc
111 )
112
113 SET(PREFERENCES_XML
114     SHAPER.xml
115 )
116
117 SET(TEXT_RESOURCES
118     XGUI_msg_fr.ts
119 )
120
121 SET(PROJECT_LIBRARIES
122     Events
123     Config
124     ModelAPI
125     ModuleBase
126     ${QT_LIBRARIES}
127     ${CAS_VIEWER}
128     ${CAS_KERNEL}
129     ${CAS_SHAPE}
130     ${PYTHON_LIBRARIES}
131     ${PyConsole}
132     ${PyInterp}
133     ${suit}
134     ${qtx}
135 )
136
137 IF(NOT ${HAVE_SALOME})
138     SET(PROJECT_LIBRARIES ${PROJECT_LIBRARIES} AppElements)
139 ENDIF(NOT ${HAVE_SALOME})
140
141
142 IF(WIN32)
143     SET(PROJECT_LIBRARIES ${PROJECT_LIBRARIES} opengl32)
144 ELSE()
145     SET(PROJECT_LIBRARIES ${PROJECT_LIBRARIES} GL)
146 ENDIF()
147
148 QT_ADD_RESOURCES(PROJECT_COMPILED_RESOURCES ${PROJECT_RESOURCES})
149 #QT5_ADD_TRANSLATION(QM_RESOURCES ${TEXT_RESOURCES})
150 # QT4_CREATE_TRANSLATION(QM_RESOURCES
151 #                        ${PROJECT_SOURCES}
152 #                        ${TEXT_RESOURCES}
153 #                        OPTIONS -extensions cpp -no-recursive
154 #                        )
155
156
157 SOURCE_GROUP ("Generated Files" FILES ${PROJECT_AUTOMOC} ${PROJECT_COMPILED_RESOURCES} ${QM_RESOURCES})
158 #SOURCE_GROUP ("Generated Files" FILES ${PROJECT_AUTOMOC} ${PROJECT_COMPILED_RESOURCES})
159 SOURCE_GROUP ("Resource Files" FILES ${TEXT_RESOURCES} ${PROJECT_RESOURCES} ${PREFERENCES_XML})
160
161 ADD_DEFINITIONS( -DXGUI_EXPORTS ${CAS_DEFINITIONS} )
162
163 SET(PROJECT_INCLUDES
164     ${PROJECT_SOURCE_DIR}/src/Events
165     ${PROJECT_SOURCE_DIR}/src/Config
166     ${PROJECT_SOURCE_DIR}/src/ModelAPI
167     ${PROJECT_SOURCE_DIR}/src/GeomAPI
168     ${PROJECT_SOURCE_DIR}/src/ModuleBase
169     ${PROJECT_SOURCE_DIR}/src/GeomAlgoAPI
170     ${CAS_INCLUDE_DIRS}
171     ${SUIT_INCLUDE})
172
173 IF(${HAVE_SALOME})
174   INCLUDE_DIRECTORIES(${SALOME_KERNEL_INCLUDE})
175 ENDIF(${HAVE_SALOME})
176
177 IF(NOT ${HAVE_SALOME})
178     SET(PROJECT_INCLUDES ${PROJECT_INCLUDES} ${APPELEMENTS_INCLUDE_DIR})
179 ENDIF(NOT ${HAVE_SALOME})
180
181 IF(TKTInspector)
182     message("TINSPECTOR is defined")
183     SET(PROJECT_LIBRARIES ${PROJECT_LIBRARIES} ${TKTInspectorAPI} ${TKTInspector} ${TKTreeModel} ${TKVInspector})
184     SET(PROJECT_INCLUDES ${PROJECT_INCLUDES} ${TINSPECTOR_INCLUDE_DIR})
185
186     ADD_DEFINITIONS(-DTINSPECTOR)
187 ENDIF()
188
189 INCLUDE_DIRECTORIES(${PROJECT_INCLUDES})
190
191 LINK_DIRECTORIES($ENV{PYTHON_LIB_DIR})
192
193 ADD_LIBRARY(XGUI SHARED
194     ${PROJECT_SOURCES}
195     ${PROJECT_HEADERS}
196     ${PROJECT_COMPILED_RESOURCES}
197     ${TEXT_RESOURCES}
198     ${QM_RESOURCES}
199     ${PREFERENCES_XML}
200     ${PROJECT_AUTOMOC}
201 )
202
203 ADD_DEPENDENCIES(XGUI ModelAPI)
204
205 # The Qt5Widgets_LIBRARIES variable also includes QtGui and QtCore
206 TARGET_LINK_LIBRARIES(XGUI ${PROJECT_LIBRARIES})
207
208 INSTALL(TARGETS XGUI DESTINATION ${SHAPER_INSTALL_BIN})
209 INSTALL(FILES ${QM_RESOURCES} DESTINATION ${SHAPER_INSTALL_QM_RESOURCES})
210 INSTALL(FILES ${PREFERENCES_XML} DESTINATION ${SHAPER_INSTALL_RESOURCES})
211 INSTALL(DIRECTORY icons/ DESTINATION ${SHAPER_INSTALL_RESOURCES})