]> SALOME platform Git repositories - modules/gui.git/blob - CMakeLists.txt
Salome HOME
Second integration of Salome On Demand
[modules/gui.git] / CMakeLists.txt
1 # Copyright (C) 2012-2023  CEA, EDF, OPEN CASCADE
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 CMAKE_MINIMUM_REQUIRED(VERSION 2.8.8 FATAL_ERROR)
20 INCLUDE(CMakeDependentOption)
21
22 # Project name
23 # ============
24 # original
25 PROJECT(SalomeGUI C CXX)
26 # upper case
27 STRING(TOUPPER ${PROJECT_NAME} PROJECT_NAME_UC)
28
29 # Common CMake macros
30 # ===================
31 SET(CONFIGURATION_ROOT_DIR $ENV{CONFIGURATION_ROOT_DIR} CACHE PATH "Path to the Salome CMake configuration files")
32 IF(EXISTS ${CONFIGURATION_ROOT_DIR})
33   LIST(APPEND CMAKE_MODULE_PATH "${CONFIGURATION_ROOT_DIR}/cmake")
34   INCLUDE(SalomeMacros NO_POLICY_SCOPE)
35 ELSE()
36   MESSAGE(FATAL_ERROR "We absolutely need the Salome CMake configuration files, please define CONFIGURATION_ROOT_DIR !")
37 ENDIF()
38
39 # Versioning
40 # ===========
41 SALOME_SETUP_VERSION(9.11.0)
42 MESSAGE(STATUS "Building ${PROJECT_NAME_UC} ${${PROJECT_NAME_UC}_VERSION} from \"${${PROJECT_NAME_UC}_GIT_SHA1}\"")
43
44 # Find KERNEL
45 # ===========
46 SET(KERNEL_ROOT_DIR $ENV{KERNEL_ROOT_DIR} CACHE PATH "Path to the Salome KERNEL")
47 IF(EXISTS ${KERNEL_ROOT_DIR})
48   FIND_PACKAGE(SalomeKERNEL REQUIRED)
49   ADD_DEFINITIONS(${KERNEL_DEFINITIONS})
50   INCLUDE_DIRECTORIES(${KERNEL_INCLUDE_DIRS})
51 ELSE(EXISTS ${KERNEL_ROOT_DIR})
52   MESSAGE(FATAL_ERROR "We absolutely need a Salome KERNEL, please define KERNEL_ROOT_DIR")
53 ENDIF(EXISTS ${KERNEL_ROOT_DIR})
54
55 # Find SalomeBootstrap
56 FIND_PACKAGE(SalomeBootstrap REQUIRED)
57
58 # Platform setup
59 # ==============
60 INCLUDE(SalomeSetupPlatform)   # From CONFIGURATION
61 # Always build libraries as shared objects:
62 SET(BUILD_SHARED_LIBS TRUE)
63
64 # User options
65 # ============
66 OPTION(SALOME_BUILD_DOC "Generate SALOME GUI documentation" ON)
67 OPTION(SALOME_BUILD_TESTS "Build SALOME tests" ON)
68 OPTION(SALOME_GUI_USE_OBSERVERS "Use study observers in GUI (advanced)" ON)
69 OPTION(SALOME_ON_DEMAND "Activate SALOME on demand feature" ON)
70 CMAKE_DEPENDENT_OPTION(SALOME_GUI_BUILD_FRENCH_DOC "Generate SALOME GUI French documentation" OFF
71                        "SALOME_BUILD_DOC" OFF)
72
73 # Advanced options:
74 CMAKE_DEPENDENT_OPTION(SALOME_LIGHT_ONLY "Build SALOME Light only (no CORBA)" OFF
75                        "NOT SALOME_KERNEL_LIGHT_ONLY" ON)
76 OPTION(SALOME_USE_VTKVIEWER "Enable VTK visualization (Mandatory in classic configurations)" ON)
77 OPTION(SALOME_USE_OCCVIEWER "Enable OCC visualization (Mandatory in classic configurations)" ON)
78 OPTION(SALOME_USE_PV3DVIEWER "Enable ParaView3D visualization (Optionally in classic configurations)" ON)
79 OPTION(SALOME_USE_GLVIEWER "Enable OpenGL visualization (Mandatory in classic configurations)" ON)
80 OPTION(SALOME_USE_GRAPHICSVIEW "Enable GraphicsView visualization (Mandatory in classic configurations)" ON)
81 OPTION(SALOME_USE_PYVIEWER "Enable Python viewer (Mandatory in classic configurations)" ON)
82 OPTION(SALOME_USE_PLOT2DVIEWER "Enable Plot2D visualization (Mandatory in classic configurations)" ON)
83 OPTION(SALOME_USE_PYCONSOLE "Enable Python GUI interface (Mandatory in classic configurations)" ON)
84 OPTION(SALOME_USE_QXGRAPHVIEWER "Enable QX graph visualization (Mandatory in classic configurations)" ON)
85 OPTION(SALOME_USE_PVVIEWER "Enable ParaView visualization (Mandatory in classic configurations)" ON)
86
87 CMAKE_DEPENDENT_OPTION(SALOME_USE_SALOMEOBJECT "Enable Salome Object (Mandatory in classic configurations)" ON
88                        "SALOME_LIGHT_ONLY" ON)
89
90 MARK_AS_ADVANCED(SALOME_LIGHT_ONLY SALOME_USE_VTKVIEWER SALOME_USE_GRAPHICSVIEW SALOME_USE_PVVIEWER)
91 MARK_AS_ADVANCED(SALOME_USE_SALOMEOBJECT SALOME_USE_OCCVIEWER SALOME_USE_GLVIEWER SALOME_USE_PLOT2DVIEWER)
92 MARK_AS_ADVANCED(SALOME_USE_PYCONSOLE SALOME_USE_QXGRAPHVIEWER SALOME_USE_PYVIEWER SALOME_USE_PV3DVIEWER)
93
94 # Prerequisites
95 # =============
96 # Find "big" prerequisites first - they reference themselves many others
97 #   -> this can help finding the smaller prerequisites and detect conficts.
98 # In our case KERNEL has already loaded many prereq which are also used in GUI:
99
100 ##
101 ## From KERNEL:
102 ##
103
104 # Various
105 FIND_PACKAGE(SalomePythonInterp REQUIRED)
106 FIND_PACKAGE(SalomePythonLibs REQUIRED)
107 FIND_PACKAGE(SalomePThread REQUIRED)
108 FIND_PACKAGE(SalomeSWIG REQUIRED)
109 FIND_PACKAGE(SalomeBoost REQUIRED)
110 FIND_PACKAGE(SalomeHDF5 REQUIRED COMPONENTS C)
111
112 # Other KERNEL optionals:
113 IF(NOT SALOME_LIGHT_ONLY)
114   FIND_PACKAGE(SalomeOmniORB REQUIRED)
115   FIND_PACKAGE(SalomeOmniORBPy REQUIRED)
116 ELSE()
117   ADD_DEFINITIONS("-DGUI_DISABLE_CORBA")
118 ENDIF()
119 IF(SALOME_BUILD_TESTS)
120   ENABLE_TESTING()
121   FIND_PACKAGE(SalomeCppUnit)
122   SALOME_LOG_OPTIONAL_PACKAGE(CppUnit SALOME_BUILD_TESTS)
123 ENDIF()
124 IF(SALOME_BUILD_DOC)
125   FIND_PACKAGE(SalomeDoxygen)
126   FIND_PACKAGE(SalomeGraphviz)
127   FIND_PACKAGE(SalomeSphinx)
128   SALOME_LOG_OPTIONAL_PACKAGE(Doxygen SALOME_BUILD_DOC)
129   SALOME_LOG_OPTIONAL_PACKAGE(Graphviz SALOME_BUILD_DOC)
130   SALOME_LOG_OPTIONAL_PACKAGE(Sphinx SALOME_BUILD_DOC)
131 ENDIF()
132
133 ##
134 ## GUI specifics
135 ##
136
137 FIND_PACKAGE(SalomeSIP REQUIRED)  # should come after Python and before PyQt
138
139 # Build with GUI observers feature
140 IF(SALOME_GUI_USE_OBSERVERS)
141   ADD_DEFINITIONS(-DWITH_SALOMEDS_OBSERVER)
142 ENDIF()
143
144 # SALOME on demand
145 IF(SALOME_ON_DEMAND)
146   ADD_DEFINITIONS(-DWITH_SALOME_ON_DEMAND)
147 ENDIF()
148
149 # Single-study GUI
150 IF(SALOME_USE_SINGLE_DESKTOP)
151   ADD_DEFINITIONS(-DSINGLE_DESKTOP)
152 ENDIF()
153
154 # OpenCASCADE
155 FIND_PACKAGE(SalomeOpenCASCADE REQUIRED)
156
157 # OpenGL
158 IF(SALOME_USE_OCCVIEWER OR SALOME_USE_VTKVIEWER OR SALOME_USE_GLVIEWER)
159   FIND_PACKAGE(SalomeOpenGL REQUIRED)
160 ENDIF()
161
162 # Qt
163 FIND_PACKAGE(SalomeQt5 REQUIRED)
164 SET(QT_SALOME_VERSION 5)
165 SET(SALOME_GUI_ENABLE_QTXWEBBROWSER TRUE)
166 IF(NOT "${QT_VERSION}" VERSION_LESS "5.6.0")
167   # Check that WebEngineWidgets component was found
168   IF(NOT Qt5WebEngineWidgets_FOUND)
169     SET(SALOME_GUI_ENABLE_QTXWEBBROWSER FALSE)
170     ADD_DEFINITIONS("-DDISABLE_QTXWEBBROWSER")
171     MESSAGE("Qt5WebEngineWidgets is not found, SALOME internal help browser will be unavailable !")
172   ENDIF()
173 ENDIF()
174
175 # PyQt
176 FIND_PACKAGE(SalomePyQt5 REQUIRED)
177
178 # Optional packages for GUI and their pre-requisites
179
180 # - GL viewer: no prereqs
181 IF(NOT SALOME_USE_GLVIEWER)
182   ADD_DEFINITIONS("-DDISABLE_GLVIEWER")
183 ENDIF()
184
185 # - OCC viewer: no prereqs
186 IF(NOT SALOME_USE_OCCVIEWER)
187   ADD_DEFINITIONS("-DDISABLE_OCCVIEWER")
188 ENDIF()
189
190 # - PV viewer: ParaView
191 IF (SALOME_USE_PVVIEWER)
192   FIND_PACKAGE(SalomeParaView)
193   SALOME_LOG_OPTIONAL_PACKAGE(ParaView SALOME_USE_PVVIEWER)
194 ELSE()
195   ADD_DEFINITIONS("-DDISABLE_PVVIEWER")
196 ENDIF()
197
198 # - PV3D viewer: ParaView3D
199 IF (SALOME_USE_PV3DVIEWER)
200   FIND_PACKAGE(SalomeParaView)
201   SALOME_LOG_OPTIONAL_PACKAGE(ParaView SALOME_USE_PV3DVIEWER)
202 ELSE()
203   ADD_DEFINITIONS("-DDISABLE_PV3DVIEWER")
204 ENDIF()
205
206 # - VTK viewer: VTK
207 IF(SALOME_USE_VTKVIEWER)
208   # Required components are listed in the FindSalomeVTK.cmake file:
209   FIND_PACKAGE(SalomeVTK)
210   SALOME_LOG_OPTIONAL_PACKAGE(VTK SALOME_USE_VTKVIEWER)
211   # VSR: TODO: since ParaView 5.8 the following is not needed, as OPENGL2 is hardcoded: to be removed (everywhere)
212   ADD_DEFINITIONS("-DVTK_OPENGL2")
213   SET(SALOME_GUI_USE_OPENGL2 TRUE)
214 ELSE()
215   ADD_DEFINITIONS("-DDISABLE_VTKVIEWER")
216 ENDIF()
217
218
219 # - Plot2d viewer: Qwt
220 IF(SALOME_USE_PLOT2DVIEWER)
221   FIND_PACKAGE(SalomeQwt)
222   SALOME_LOG_OPTIONAL_PACKAGE(Qwt SALOME_USE_PLOT2DVIEWER)
223 ELSE()
224   ADD_DEFINITIONS("-DDISABLE_PLOT2DVIEWER")
225 ENDIF()
226
227 # - Graphics viewer: no prereqs
228 IF (NOT SALOME_USE_GRAPHICSVIEW)
229   ADD_DEFINITIONS("-DDISABLE_GRAPHICSVIEW")
230 ENDIF()
231
232 # - Python editor: no prereqs
233 IF (NOT SALOME_USE_PYVIEWER)
234   ADD_DEFINITIONS("-DDISABLE_PYVIEWER")
235 ENDIF()
236
237 # - Python console: no prereqs
238 IF(SALOME_USE_PYCONSOLE)
239   # Build with obsolete Python module's methods
240   ADD_DEFINITIONS(-DCALL_OLD_METHODS)
241 ELSE()
242   ADD_DEFINITIONS("-DDISABLE_PYCONSOLE")
243 ENDIF()
244
245 # - Qx viewer: no prereqs
246 IF(NOT SALOME_USE_QXGRAPHVIEWER)
247   ADD_DEFINITIONS("-DDISABLE_QXGRAPHVIEWER")
248 ENDIF()
249
250 # - SALOME object: no prereqs
251 IF(NOT SALOME_USE_SALOMEOBJECT)
252   ADD_DEFINITIONS("-DDISABLE_SALOMEOBJECT")
253 ENDIF()
254
255 # Other global definitions
256 ADD_DEFINITIONS("-DGLOBAL_DOUBLE_CONVERSION")
257
258 # Detection summary:
259 SALOME_PACKAGE_REPORT_AND_CHECK()
260
261 # Directories
262 # (default values taken from KERNEL)
263 # ===========
264
265 SET(SALOME_INSTALL_BINS "${SALOME_INSTALL_BINS}" CACHE PATH "Install path: SALOME binaries")
266 SET(SALOME_INSTALL_LIBS "${SALOME_INSTALL_LIBS}" CACHE PATH "Install path: SALOME libs")
267 SET(SALOME_INSTALL_IDLS "${SALOME_INSTALL_IDLS}" CACHE PATH "Install path: SALOME IDL files")
268 SET(SALOME_INSTALL_HEADERS "${SALOME_INSTALL_HEADERS}" CACHE PATH "Install path: SALOME headers")
269 SET(SALOME_INSTALL_SCRIPT_SCRIPTS "${SALOME_INSTALL_SCRIPT_SCRIPTS}" CACHE PATH
270    "Install path: SALOME scripts")
271 SET(SALOME_INSTALL_SCRIPT_DATA "${SALOME_INSTALL_SCRIPT_DATA}" CACHE PATH
272    "Install path: SALOME script data")
273 SET(SALOME_INSTALL_SCRIPT_PYTHON "${SALOME_INSTALL_SCRIPT_PYTHON}" CACHE PATH
274    "Install path: SALOME Python scripts")
275 SET(SALOME_INSTALL_PYTHON "${SALOME_INSTALL_PYTHON}" CACHE PATH "Install path: SALOME Python stuff")
276 SET(SALOME_INSTALL_PYTHON_SHARED "${SALOME_INSTALL_PYTHON_SHARED}" CACHE PATH
277    "Install path: SALOME Python shared modules")
278 SET(SALOME_INSTALL_CMAKE "${SALOME_INSTALL_CMAKE}" CACHE PATH "Install path: SALOME CMake files")
279 SET(SALOME_INSTALL_CMAKE_LOCAL "${SALOME_INSTALL_CMAKE_LOCAL}" CACHE PATH
280     "Install path: local SALOME CMake files")
281 SET(SALOME_INSTALL_AMCONFIG_LOCAL "${SALOME_INSTALL_AMCONFIG_LOCAL}" CACHE PATH
282   "Install path: local SALOME config files (obsolete, to be removed)")
283
284 SET(SALOME_INSTALL_RES "${SALOME_INSTALL_RES}" CACHE PATH "Install path: SALOME resources")
285 SET(SALOME_INSTALL_DOC "${SALOME_INSTALL_DOC}" CACHE PATH "Install path: SALOME documentation")
286
287 # Specific to GUI:
288 SET(SALOME_GUI_INSTALL_RES_DATA "${SALOME_INSTALL_RES}/gui" CACHE PATH
289     "Install path: SALOME GUI specific data")
290 SET(SALOME_GUI_INSTALL_RES_SCRIPTS "${SALOME_INSTALL_RES}/gui" CACHE PATH
291     "Install path: SALOME GUI scripts")
292 SET(SALOME_GUI_INSTALL_PLUGINS share/salome/plugins/gui CACHE PATH
293     "Install path: SALOME GUI plugins")
294
295 MARK_AS_ADVANCED(SALOME_INSTALL_BINS SALOME_INSTALL_LIBS SALOME_INSTALL_IDLS SALOME_INSTALL_HEADERS)
296 MARK_AS_ADVANCED(SALOME_INSTALL_SCRIPT_SCRIPTS SALOME_INSTALL_SCRIPT_DATA SALOME_INSTALL_SCRIPT_PYTHON)
297 MARK_AS_ADVANCED(SALOME_INSTALL_APPLISKEL_SCRIPTS  SALOME_INSTALL_APPLISKEL_PYTHON SALOME_INSTALL_CMAKE SALOME_INSTALL_CMAKE_LOCAL SALOME_INSTALL_RES)
298 MARK_AS_ADVANCED(SALOME_INSTALL_PYTHON SALOME_INSTALL_PYTHON_SHARED)
299 MARK_AS_ADVANCED(SALOME_GUI_INSTALL_RES_DATA SALOME_GUI_INSTALL_RES_SCRIPTS SALOME_GUI_INSTALL_PLUGINS)
300 MARK_AS_ADVANCED(SALOME_INSTALL_AMCONFIG_LOCAL SALOME_INSTALL_DOC)
301
302 # Accumulate environment variables for GUI module
303 SALOME_ACCUMULATE_ENVIRONMENT(PYTHONPATH NOCHECK ${CMAKE_INSTALL_PREFIX}/${SALOME_INSTALL_BINS}
304                                                  ${CMAKE_INSTALL_PREFIX}/${SALOME_INSTALL_PYTHON}
305                                                  ${CMAKE_INSTALL_PREFIX}/${SALOME_INSTALL_LIBS}
306                                                  ${CMAKE_INSTALL_PREFIX}/${SALOME_INSTALL_PYTHON_SHARED})
307 SALOME_ACCUMULATE_ENVIRONMENT(LD_LIBRARY_PATH NOCHECK ${CMAKE_INSTALL_PREFIX}/${SALOME_INSTALL_LIBS})
308
309 # Sources
310 # ========
311 IF(NOT SALOME_LIGHT_ONLY)
312   ADD_SUBDIRECTORY(idl)
313 ENDIF()
314
315 ADD_SUBDIRECTORY(adm_local)
316 ADD_SUBDIRECTORY(src)
317 IF(SALOME_BUILD_DOC)
318   ADD_SUBDIRECTORY(doc)
319 ENDIF()
320 ADD_SUBDIRECTORY(bin)
321 ADD_SUBDIRECTORY(tools)
322
323 # Header configuration
324 # ====================
325 SALOME_CONFIGURE_FILE(GUI_version.h.in GUI_version.h INSTALL ${SALOME_INSTALL_HEADERS})
326
327 # Configuration export
328 # (here only the level 1 prerequisites are exposed)
329 # ====================
330 INCLUDE(CMakePackageConfigHelpers)
331
332 # List of targets in this project we want to make visible to the rest of the world.
333 # They all have to be INSTALL'd with the option "EXPORT ${PROJECT_NAME}TargetGroup"
334 SET(_${PROJECT_NAME}_exposed_targets
335     CAM CASCatch DDS Event LightApp LogWindow ObjBrowser
336     QDS qtx SalomePrs SalomeStyle std SUITApp suit ViewerTools ViewerData
337     ImageComposer
338     SalomeApprc_utils
339 )
340
341 IF(SALOME_USE_OCCVIEWER OR SALOME_USE_VTKVIEWER OR SALOME_USE_GLVIEWER)
342   LIST(APPEND _${PROJECT_NAME}_exposed_targets
343        OpenGLUtils)
344 ENDIF(SALOME_USE_OCCVIEWER OR SALOME_USE_VTKVIEWER OR SALOME_USE_GLVIEWER)
345
346 # SALOME object specific targets:
347 IF(SALOME_USE_SALOMEOBJECT)
348   LIST(APPEND _${PROJECT_NAME}_exposed_targets
349        SalomeObject)
350 ENDIF(SALOME_USE_SALOMEOBJECT)
351
352 # GL specific targets:
353 IF(SALOME_USE_GLVIEWER)
354   LIST(APPEND _${PROJECT_NAME}_exposed_targets
355        GLViewer)
356 ENDIF(SALOME_USE_GLVIEWER)
357
358 # VTK specific targets:
359 IF(SALOME_USE_VTKVIEWER)
360   LIST(APPEND _${PROJECT_NAME}_exposed_targets
361        VTKViewer )
362   IF(SALOME_USE_SALOMEOBJECT)
363     LIST(APPEND _${PROJECT_NAME}_exposed_targets
364          SVTK)
365   ENDIF(SALOME_USE_SALOMEOBJECT)
366 ENDIF(SALOME_USE_VTKVIEWER)
367
368 # OCC specific targets:
369 IF(SALOME_USE_OCCVIEWER)
370   LIST(APPEND _${PROJECT_NAME}_exposed_targets
371        OCCViewer)
372   IF(SALOME_USE_SALOMEOBJECT)
373     LIST(APPEND _${PROJECT_NAME}_exposed_targets
374          SOCC)
375   ENDIF(SALOME_USE_SALOMEOBJECT)
376 ENDIF(SALOME_USE_OCCVIEWER)
377
378 # PV3D specific targets:
379 IF(SALOME_USE_PV3DVIEWER)
380   LIST(APPEND _${PROJECT_NAME}_exposed_targets 
381        PV3DViewer)
382   IF(SALOME_USE_SALOMEOBJECT)
383     LIST(APPEND _${PROJECT_NAME}_exposed_targets 
384          SPV3D)
385   ENDIF(SALOME_USE_SALOMEOBJECT)
386 ENDIF(SALOME_USE_PV3DVIEWER)
387
388 # Plot2d specific targets:
389 IF(SALOME_USE_PLOT2DVIEWER)
390   LIST(APPEND _${PROJECT_NAME}_exposed_targets
391        Plot2d)
392   IF(SALOME_USE_SALOMEOBJECT)
393     LIST(APPEND _${PROJECT_NAME}_exposed_targets
394          SPlot2d)
395   ENDIF(SALOME_USE_SALOMEOBJECT)
396 ENDIF(SALOME_USE_PLOT2DVIEWER)
397
398 # Qx specific targets:
399 IF(SALOME_USE_QXGRAPHVIEWER)
400   LIST(APPEND _${PROJECT_NAME}_exposed_targets
401        QxScene)
402 ENDIF(SALOME_USE_QXGRAPHVIEWER)
403
404 # GraphicsView specific targets:
405 IF(SALOME_USE_GRAPHICSVIEW)
406   LIST(APPEND _${PROJECT_NAME}_exposed_targets
407        GraphicsView)
408 ENDIF(SALOME_USE_GRAPHICSVIEW)
409
410 # PyEditor/Viewer specific targets:
411 IF(SALOME_USE_PYVIEWER)
412   LIST(APPEND _${PROJECT_NAME}_exposed_targets
413        PyEditor PyViewer)
414 ENDIF(SALOME_USE_PYVIEWER)
415
416 # ParaView viewer specific targets:
417 IF(SALOME_USE_PVVIEWER)
418   LIST(APPEND _${PROJECT_NAME}_exposed_targets PVViewer PVServerService)
419 ENDIF()
420
421 # Python-based packages specific targets:
422 IF(SALOME_USE_PYCONSOLE)
423   LIST(APPEND _${PROJECT_NAME}_exposed_targets
424        PyInterp PyConsole SalomePyQtGUILight)
425   IF(SALOME_USE_PLOT2DVIEWER)
426     LIST(APPEND _${PROJECT_NAME}_exposed_targets SalomePyQt)
427   ENDIF()
428   IF(NOT SALOME_LIGHT_ONLY)
429     LIST(APPEND _${PROJECT_NAME}_exposed_targets SalomePyQtGUI)
430   ENDIF()
431   IF(SALOME_USE_VTKVIEWER)
432     LIST(APPEND _${PROJECT_NAME}_exposed_targets SalomePy)
433   ENDIF(SALOME_USE_VTKVIEWER)
434 ENDIF(SALOME_USE_PYCONSOLE)
435
436 # CORBA specific targets:
437 IF(NOT SALOME_LIGHT_ONLY)
438   LIST(APPEND _${PROJECT_NAME}_exposed_targets
439        SalomeIDLGUI SalomeSession SalomeApp SalomeAppSL SalomeAppImpl SalomeGuiHelpers SalomeTreeData ToolsGUI)
440 ENDIF(NOT SALOME_LIGHT_ONLY)
441
442 # Add all targets to the build-tree export set
443 EXPORT(TARGETS ${_${PROJECT_NAME}_exposed_targets}
444   FILE ${PROJECT_BINARY_DIR}/${PROJECT_NAME}Targets.cmake)
445
446 # Create the configuration files:
447 #   - in the build tree:
448
449 # Ensure the variables are always defined for the configure:
450 SET(KERNEL_ROOT_DIR "${KERNEL_ROOT_DIR}")
451 SET(SIP_ROOT_DIR "${SIP_ROOT_DIR}")
452 SET(QT_ROOT_DIR "${QT5_ROOT_DIR}")
453 SET(PYQT_ROOT_DIR "${PYQT5_ROOT_DIR}")
454
455 SET(OPENCASCADE_ROOT_DIR "${OPENCASCADE_ROOT_DIR}")
456 SET(OPENGL_ROOT_DIR "${OPENGL_ROOT_DIR}")
457 SET(PARAVIEW_ROOT_DIR "${PARAVIEW_ROOT_DIR}")
458 SET(VTK_ROOT_DIR "${VTK_ROOT_DIR}")
459 SET(QWT_ROOT_DIR "${QWT_ROOT_DIR}")
460
461 SET(CONF_INCLUDE_DIRS "${PROJECT_SOURCE_DIR}/include" "${PROJECT_BINARY_DIR}/include")
462
463 # Build variables that will be expanded when configuring Salome<MODULE>Config.cmake:
464 SALOME_CONFIGURE_PREPARE(OpenCASCADE OpenGL Qt5 PyQt5 Qwt SIP ParaView VTK)
465
466 CONFIGURE_PACKAGE_CONFIG_FILE(${PROJECT_NAME}Config.cmake.in
467     ${PROJECT_BINARY_DIR}/${PROJECT_NAME}Config.cmake
468     INSTALL_DESTINATION "${SALOME_INSTALL_CMAKE_LOCAL}"
469     PATH_VARS CONF_INCLUDE_DIRS SALOME_INSTALL_CMAKE_LOCAL CMAKE_INSTALL_PREFIX
470        KERNEL_ROOT_DIR SIP_ROOT_DIR QT_ROOT_DIR PYQT_ROOT_DIR OPENCASCADE_ROOT_DIR
471        OPENGL_ROOT_DIR PARAVIEW_ROOT_DIR VTK_ROOT_DIR QWT_ROOT_DIR)
472
473 #   - in the install tree (VSR 16/08/2013: TEMPORARILY COMMENT THIS - TO REMOVE?):
474 #       Get the relative path of the include directory so
475 #       we can register it in the generated configuration files:
476 #SET(CONF_INCLUDE_DIRS "${CMAKE_INSTALL_PREFIX}/${INSTALL_INCLUDE_DIR}")
477 #CONFIGURE_PACKAGE_CONFIG_FILE(adm_local/cmake_files/${PROJECT_NAME}Config.cmake.in
478 #    ${PROJECT_BINARY_DIR}/to_install/${PROJECT_NAME}Config.cmake
479 #    INSTALL_DESTINATION "${SALOME_INSTALL_CMAKE_LOCAL}"
480 #    PATH_VARS CONF_INCLUDE_DIRS SALOME_INSTALL_CMAKE_LOCAL CMAKE_INSTALL_PREFIX
481 #       KERNEL_ROOT_DIR SIP_ROOT_DIR QT_ROOT_DIR PYQT_ROOT_DIR OPENCASCADE_ROOT_DIR
482 #       OPENGL_ROOT_DIR PARAVIEW_ROOT_DIR VTK_ROOT_DIR QWT_ROOT_DIR)
483
484 WRITE_BASIC_PACKAGE_VERSION_FILE(${PROJECT_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake
485     VERSION ${${PROJECT_NAME_UC}_VERSION}
486     COMPATIBILITY AnyNewerVersion)
487
488 # Install the CMake configuration files:
489 INSTALL(FILES
490   "${PROJECT_BINARY_DIR}/${PROJECT_NAME}Config.cmake"
491   "${PROJECT_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake"
492   DESTINATION "${SALOME_INSTALL_CMAKE_LOCAL}")
493
494 # Install the export set for use with the install-tree
495 INSTALL(EXPORT ${PROJECT_NAME}TargetGroup DESTINATION "${SALOME_INSTALL_CMAKE_LOCAL}"
496         FILE ${PROJECT_NAME}Targets.cmake)