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