Salome HOME
[Huge] Introducing MEDCalc
[modules/med.git] / CMakeLists.txt
1 # Copyright (C) 2012-2015  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 CMAKE_MINIMUM_REQUIRED(VERSION 2.8.8 FATAL_ERROR)
21 INCLUDE(CMakeDependentOption)
22 PROJECT(SalomeMED C CXX)
23
24 # Ensure a proper linker behavior:
25 CMAKE_POLICY(SET CMP0003 NEW)
26
27 # Versioning
28 # ===========
29 # Project name, upper case
30 STRING(TOUPPER ${PROJECT_NAME} PROJECT_NAME_UC)
31
32 SET(${PROJECT_NAME_UC}_MAJOR_VERSION 7)
33 SET(${PROJECT_NAME_UC}_MINOR_VERSION 6)
34 SET(${PROJECT_NAME_UC}_PATCH_VERSION 0)
35 SET(${PROJECT_NAME_UC}_VERSION
36   ${${PROJECT_NAME_UC}_MAJOR_VERSION}.${${PROJECT_NAME_UC}_MINOR_VERSION}.${${PROJECT_NAME_UC}_PATCH_VERSION})
37 SET(${PROJECT_NAME_UC}_VERSION_DEV 1)
38
39 #
40 # Kernel detection comes before user options to be
41 # able to take previous values of global options ...
42 #
43 SET(_default_MPI OFF)
44 IF(NOT SALOME_MED_STANDALONE)
45   SET(KERNEL_ROOT_DIR $ENV{KERNEL_ROOT_DIR} CACHE PATH "Path to the Salome KERNEL")
46   IF(EXISTS ${KERNEL_ROOT_DIR})
47     LIST(APPEND CMAKE_MODULE_PATH "${KERNEL_ROOT_DIR}/salome_adm/cmake_files")
48     INCLUDE(SalomeMacros)
49     FIND_PACKAGE(SalomeKERNEL REQUIRED)
50     KERNEL_WITH_CORBA() #check whether KERNEL builded with CORBA
51     ADD_DEFINITIONS(${KERNEL_DEFINITIONS})
52     INCLUDE_DIRECTORIES(${KERNEL_INCLUDE_DIRS})
53     SET(_default_MPI ${SALOME_USE_MPI})
54   ELSE(EXISTS ${KERNEL_ROOT_DIR})
55     MESSAGE(FATAL_ERROR "We absolutely need a Salome KERNEL, please define KERNEL_ROOT_DIR or turn option SALOME_MED_STANDALONE to ON !")
56   ENDIF(EXISTS ${KERNEL_ROOT_DIR})
57   LIST(APPEND CMAKE_MODULE_PATH "${KERNEL_ROOT_DIR}/salome_adm/cmake_files")
58 ELSE(NOT SALOME_MED_STANDALONE)
59   LIST(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/adm_local_without_kernel/cmake_files")
60   INCLUDE(SalomeMacros)
61 ENDIF(NOT SALOME_MED_STANDALONE)
62
63 # Platform setup
64 # ==============
65 INCLUDE(SalomeSetupPlatform)
66
67 IF(NOT SALOME_MED_STANDALONE)
68   FIND_PACKAGE(SalomePThread REQUIRED) # for MEDCouplingCorba/Test for EDF
69   FIND_PACKAGE(SalomeOmniORB REQUIRED)
70 ENDIF(NOT SALOME_MED_STANDALONE)
71 #
72 # User options
73 # ============
74 INCLUDE(CMakeDependentOption)
75 OPTION(SALOME_MED_STANDALONE "Build MED without CORBA bindings. When OFF, exchange to PARAVIS is disabled." OFF)
76 OPTION(SALOME_MED_MICROMED "Build MED without MED file dependancy." OFF)
77 OPTION(SALOME_MED_ENABLE_PYTHON "Build PYTHON bindings." ON)
78 OPTION(SALOME_MED_ENABLE_PARTITIONER "Build MEDPartitioner." ON)
79 OPTION(SALOME_MED_ENABLE_RENUMBER "Build Renumber." ON)
80 OPTION(SALOME_MED_WITH_FILE_EXAMPLES "Install examples of files containing meshes and fields of different formats." ON)
81 OPTION(SALOME_USE_MPI "(Use MPI containers) - For MED this triggers the build of ParaMEDMEM." ${_default_MPI})
82 CMAKE_DEPENDENT_OPTION(SALOME_BUILD_GUI "Build GUI of MED." ON
83                        "NOT SALOME_MED_STANDALONE" OFF)
84 OPTION(SALOME_BUILD_TESTS "Build MED tests." ON)
85 OPTION(SALOME_BUILD_DOC "Build MED doc." ON)
86 CMAKE_DEPENDENT_OPTION(SALOME_MED_PARTITIONER_METIS "Enable metis graph library in MEDPartitioner." ON "SALOME_MED_ENABLE_PARTITIONER" OFF)
87 CMAKE_DEPENDENT_OPTION(SALOME_MED_PARTITIONER_SCOTCH "Enable scotch graph library in MEDPartitioner." ON "SALOME_MED_ENABLE_PARTITIONER;NOT SALOME_USE_MPI" OFF)
88 CMAKE_DEPENDENT_OPTION(SALOME_MED_PARTITIONER_PARMETIS "Enable parmetis graph library in MEDPartitioner." ON "SALOME_MED_ENABLE_PARTITIONER;SALOME_USE_MPI" OFF)
89 IF(WIN32)
90   CMAKE_DEPENDENT_OPTION(SALOME_MED_MEDLOADER_USE_XDR "Enable use of XDR for SauvReader." ON "NOT SALOME_MED_MICROMED" OFF)
91 ENDIF(WIN32)
92
93 #
94 # Set list of prerequisites
95 # =========================
96
97 IF(NOT SALOME_MED_STANDALONE)
98   SET(KERNEL_ROOT_DIR $ENV{KERNEL_ROOT_DIR} CACHE PATH "Path to the Salome KERNEL")
99   IF(EXISTS ${KERNEL_ROOT_DIR})
100     LIST(APPEND CMAKE_MODULE_PATH "${KERNEL_ROOT_DIR}/salome_adm/cmake_files")
101     INCLUDE(SalomeMacros)
102     FIND_PACKAGE(SalomeKERNEL REQUIRED)
103     KERNEL_WITH_CORBA() #check whether KERNEL builded with CORBA
104   ELSE(EXISTS ${KERNEL_ROOT_DIR})
105     MESSAGE(FATAL_ERROR "We absolutely need a Salome KERNEL, please define KERNEL_ROOT_DIR or turn option SALOME_MED_STANDALONE to ON !")
106   ENDIF(EXISTS ${KERNEL_ROOT_DIR})
107   LIST(APPEND CMAKE_MODULE_PATH "${KERNEL_ROOT_DIR}/salome_adm/cmake_files")
108   LIST(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/adm_local/cmake_files")
109 ELSE(NOT SALOME_MED_STANDALONE)
110   LIST(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/adm_local/cmake_files")
111   LIST(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/adm_local_without_kernel/cmake_files")
112   INCLUDE(SalomeMacros)
113 ENDIF(NOT SALOME_MED_STANDALONE)
114
115 IF(NOT SALOME_MED_MICROMED)
116   FIND_PACKAGE(SalomeHDF5 REQUIRED)
117   FIND_PACKAGE(SalomeMEDFile REQUIRED)
118   # XDR stuff
119   IF(NOT WIN32)
120     FIND_PACKAGE(SalomeXDR REQUIRED)
121   ELSE(NOT WIN32)
122     IF(SALOME_MED_MEDLOADER_USE_XDR)
123       FIND_PACKAGE(SalomeXDR REQUIRED)
124     ENDIF(SALOME_MED_MEDLOADER_USE_XDR)
125   ENDIF(NOT WIN32)
126   # End of XDR Stuff
127   IF(SALOME_MED_ENABLE_PARTITIONER)
128     FIND_PACKAGE(SalomeLibXml2)
129     SALOME_LOG_OPTIONAL_PACKAGE(LibXml2 SALOME_MED_ENABLE_PARTITIONER)
130     IF(SALOME_MED_PARTITIONER_METIS)
131       FIND_PACKAGE(SalomeMetis)
132       SALOME_LOG_OPTIONAL_PACKAGE(Metis SALOME_MED_PARTITIONER_METIS)
133       ADD_DEFINITIONS("-DMED_ENABLE_METIS")
134     ENDIF(SALOME_MED_PARTITIONER_METIS)
135     IF(SALOME_MED_PARTITIONER_SCOTCH)
136       FIND_PACKAGE(SalomeScotch)
137       SALOME_LOG_OPTIONAL_PACKAGE(Scotch SALOME_MED_PARTITIONER_SCOTCH)
138       ADD_DEFINITIONS("-DMED_ENABLE_SCOTCH")
139     ENDIF(SALOME_MED_PARTITIONER_SCOTCH)
140   ENDIF(SALOME_MED_ENABLE_PARTITIONER)
141 ENDIF(NOT SALOME_MED_MICROMED)
142
143 # Find GUI (optional)
144 # ===========
145 IF(SALOME_BUILD_GUI)
146     SET(GUI_ROOT_DIR $ENV{GUI_ROOT_DIR} CACHE PATH "Path to the Salome GUI")
147     IF(EXISTS ${GUI_ROOT_DIR})
148       LIST(APPEND CMAKE_MODULE_PATH "${GUI_ROOT_DIR}/adm_local/cmake_files")
149       FIND_PACKAGE(SalomeGUI REQUIRED)
150       SALOME_GUI_WITH_CORBA() #check whether GUI builded with CORBA
151       SALOME_GUI_MODE(SALOME_USE_SALOMEOBJECT SALOME_USE_PYCONSOLE OPTIONAL SALOME_USE_PVVIEWER)
152       ADD_DEFINITIONS(${GUI_DEFINITIONS})
153       INCLUDE_DIRECTORIES(${GUI_INCLUDE_DIRS})
154     ELSE(EXISTS ${GUI_ROOT_DIR})
155       MESSAGE(FATAL_ERROR "We absolutely need a Salome GUI, please define GUI_ROOT_DIR or turn option SALOME_BUILD_GUI to OFF !")
156     ENDIF(EXISTS ${GUI_ROOT_DIR})
157     FIND_PACKAGE(SalomeQt4 REQUIRED COMPONENTS QtCore QtGui)
158     FIND_PACKAGE(SalomeCAS REQUIRED) # maybe one day it will disappear ...
159 ENDIF(SALOME_BUILD_GUI)
160
161 LIST(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/adm_local/cmake_files")
162
163 ENABLE_TESTING() # let it outsite because even if SALOME_BUILD_TESTS is OFF, python tests that not need additional compilation can be run.
164
165 IF(SALOME_BUILD_TESTS)
166   FIND_PACKAGE(SalomeCppUnit)
167   SALOME_LOG_OPTIONAL_PACKAGE(CppUnit SALOME_BUILD_TESTS)
168 ENDIF(SALOME_BUILD_TESTS)
169
170 IF(SALOME_USE_MPI)
171   FIND_PACKAGE(SalomeMPI REQUIRED)
172   ADD_DEFINITIONS("-DHAVE_MPI")
173   IF(SALOME_MED_PARTITIONER_PARMETIS)
174     FIND_PACKAGE(SalomeParMetis)
175     SALOME_LOG_OPTIONAL_PACKAGE(ParMetis SALOME_MED_PARTITIONER_PARMETIS)
176     ADD_DEFINITIONS("-DMED_ENABLE_PARMETIS")
177   ENDIF(SALOME_MED_PARTITIONER_PARMETIS)
178 ENDIF(SALOME_USE_MPI)
179
180 IF(SALOME_MED_ENABLE_RENUMBER)
181   FIND_PACKAGE(SalomeBoost)
182   SALOME_LOG_OPTIONAL_PACKAGE(Boost SALOME_MED_ENABLE_RENUMBER)
183 ENDIF(SALOME_MED_ENABLE_RENUMBER)
184
185 IF(SALOME_BUILD_DOC)
186   FIND_PACKAGE(SalomeDoxygen)
187   FIND_PACKAGE(SalomeGraphviz)
188   FIND_PACKAGE(SalomeSphinx)
189   SALOME_LOG_OPTIONAL_PACKAGE(Doxygen SALOME_BUILD_DOC)
190   SALOME_LOG_OPTIONAL_PACKAGE(Graphviz SALOME_BUILD_DOC)
191   SALOME_LOG_OPTIONAL_PACKAGE(Sphinx SALOME_BUILD_DOC)
192 ENDIF(SALOME_BUILD_DOC)
193
194 IF(SALOME_MED_ENABLE_PYTHON)
195   FIND_PACKAGE(SalomePython)
196   FIND_PACKAGE(SalomeSWIG)
197   SALOME_LOG_OPTIONAL_PACKAGE(Python SALOME_MED_ENABLE_PYTHON)
198   SALOME_LOG_OPTIONAL_PACKAGE(SWIG   SALOME_MED_ENABLE_PYTHON)
199   IF(NOT SALOME_MED_STANDALONE)
200     FIND_PACKAGE(SalomeOmniORBPy REQUIRED)
201   ENDIF(NOT SALOME_MED_STANDALONE)
202   # Set the extra flags for SWIG for numpy and scipy
203   SET(SWIG_EXTRA_FLAGS_FOR_NUMPYANDSCIPY)
204   IF(NUMPY_FOUND)
205     SET(SWIG_EXTRA_FLAGS_FOR_NUMPYANDSCIPY "-DWITH_NUMPY")
206   ENDIF(NUMPY_FOUND)
207   IF(SCIPY_FOUND)
208     SET(SWIG_EXTRA_FLAGS_FOR_NUMPYANDSCIPY "${SWIG_EXTRA_FLAGS_FOR_NUMPYANDSCIPY};-DWITH_SCIPY")
209   ENDIF(SCIPY_FOUND)
210 ENDIF(SALOME_MED_ENABLE_PYTHON)
211
212 # Detection report
213 SALOME_PACKAGE_REPORT_AND_CHECK()
214
215 # Directories
216 #
217 # Directories have to be given after prerequisites (to be able to use
218 # Python version string for example).
219 # ===========
220 SET(SALOME_INSTALL_BINS bin/salome CACHE PATH "Install path: SALOME binaries")
221 SET(SALOME_INSTALL_LIBS lib/salome CACHE PATH "Install path: SALOME libs")
222 SET(SALOME_INSTALL_IDLS idl/salome CACHE PATH "Install path: SALOME IDL files")
223 SET(SALOME_INSTALL_HEADERS include/salome CACHE PATH "Install path: SALOME headers")
224 SET(SALOME_INSTALL_SCRIPT_SCRIPTS ${SALOME_INSTALL_BINS} CACHE PATH
225    "Install path: SALOME scripts")
226 SET(SALOME_INSTALL_SCRIPT_DATA ${SALOME_INSTALL_BINS} CACHE PATH
227    "Install path: SALOME script data")
228 SET(SALOME_INSTALL_SCRIPT_PYTHON ${SALOME_INSTALL_BINS} CACHE PATH
229    "Install path: SALOME Python scripts")
230 SET(SALOME_INSTALL_APPLISKEL_SCRIPTS ${SALOME_INSTALL_BINS}/appliskel CACHE PATH
231    "Install path: SALOME application skeleton - scripts")
232 SET(SALOME_INSTALL_APPLISKEL_PYTHON ${SALOME_INSTALL_BINS}/appliskel CACHE PATH
233    "Install path: SALOME application skeleton - Python")
234 SET(SALOME_INSTALL_CMAKE salome_adm/cmake_files CACHE PATH "Install path: SALOME CMake files")
235 SET(SALOME_INSTALL_CMAKE_LOCAL adm_local/cmake_files CACHE PATH
236    "Install path: local SALOME CMake files")
237
238 IF(SALOME_MED_ENABLE_PYTHON)
239   SET(_pydir lib/python${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}/site-packages)
240   SET(SALOME_INSTALL_PYTHON ${_pydir}/salome CACHE PATH "Install path: SALOME Python stuff")
241   SET(SALOME_INSTALL_PYTHON_SHARED ${SALOME_INSTALL_PYTHON}/shared_modules CACHE PATH
242     "Install path: SALOME Python shared modules")
243 ENDIF(SALOME_MED_ENABLE_PYTHON)
244
245 SET(SALOME_INSTALL_RES share/salome/resources CACHE PATH "Install path: SALOME resources")
246 SET(SALOME_INSTALL_DOC share/doc/salome CACHE PATH "Install path: SALOME documentation")
247
248 # Med specific:
249
250 SET(SALOME_MED_INSTALL_RES_DATA "${SALOME_INSTALL_RES}/med" CACHE PATH "Install path: SALOME MED specific data")
251 SET(SALOME_MED_INSTALL_RES_SCRIPTS "${SALOME_INSTALL_RES}/med" CACHE PATH "Install path: SALOME MED specific scripts")
252
253 MARK_AS_ADVANCED(SALOME_INSTALL_BINS SALOME_INSTALL_LIBS SALOME_INSTALL_IDLS SALOME_INSTALL_HEADERS)
254 MARK_AS_ADVANCED(SALOME_INSTALL_SCRIPT_SCRIPTS SALOME_INSTALL_SCRIPT_DATA SALOME_INSTALL_SCRIPT_PYTHON)
255 MARK_AS_ADVANCED(SALOME_INSTALL_APPLISKEL_SCRIPTS  SALOME_INSTALL_APPLISKEL_PYTHON SALOME_INSTALL_CMAKE SALOME_INSTALL_CMAKE_LOCAL SALOME_INSTALL_RES)
256 MARK_AS_ADVANCED(SALOME_INSTALL_PYTHON SALOME_INSTALL_PYTHON_SHARED SALOME_MED_INSTALL_RES_DATA SALOME_MED_INSTALL_RES_SCRIPTS SALOME_INSTALL_DOC)
257
258 # Header configuration
259 # ====================
260 SALOME_XVERSION(${PROJECT_NAME})
261 SALOME_CONFIGURE_FILE(MED_version.h.in MED_version.h INSTALL ${SALOME_INSTALL_HEADERS})
262 SALOME_CONFIGURE_FILE(VERSION.in VERSION INSTALL ${SALOME_INSTALL_BINS})
263
264 # Accumulate environment variables for MED module
265 SALOME_ACCUMULATE_ENVIRONMENT(PYTHONPATH NOCHECK ${CMAKE_INSTALL_PREFIX}/${SALOME_INSTALL_BINS}
266                                                  ${CMAKE_INSTALL_PREFIX}/${SALOME_INSTALL_PYTHON})
267 SALOME_ACCUMULATE_ENVIRONMENT(LD_LIBRARY_PATH NOCHECK ${CMAKE_INSTALL_PREFIX}/${SALOME_INSTALL_LIBS})
268
269
270 # Sources
271 # ========
272 IF(WIN32)
273   ADD_DEFINITIONS("-D_USE_MATH_DEFINES")
274 ENDIF(WIN32)
275
276 ADD_SUBDIRECTORY(src)
277 ADD_SUBDIRECTORY(adm_local)
278
279 IF(SALOME_BUILD_DOC)
280   ADD_SUBDIRECTORY(doc)
281 ENDIF(SALOME_BUILD_DOC)
282
283 IF(NOT SALOME_MED_STANDALONE)
284   ADD_SUBDIRECTORY(idl)
285 ELSE(NOT SALOME_MED_STANDALONE)
286   ADD_SUBDIRECTORY(adm_local_without_kernel)
287 ENDIF(NOT SALOME_MED_STANDALONE)
288
289 IF(NOT SALOME_MED_MICROMED)
290   IF(SALOME_MED_WITH_FILE_EXAMPLES)
291     ADD_SUBDIRECTORY(resources)
292   ENDIF(SALOME_MED_WITH_FILE_EXAMPLES)
293 ENDIF(NOT SALOME_MED_MICROMED)
294
295 # Configuration export
296 # ====================
297 INCLUDE(CMakePackageConfigHelpers)
298
299 # List of targets in this project we want to make visible to the rest of the world.
300 # They all have to be INSTALL'd with the option "EXPORT ${PROJECT_NAME}TargetGroup"
301 SET(_${PROJECT_NAME}_exposed_targets
302    interpkernel medcoupling medcouplingremapper)
303
304 IF(NOT SALOME_MED_MICROMED)
305   LIST(APPEND _${PROJECT_NAME}_exposed_targets medloader)
306   IF(SALOME_MED_ENABLE_RENUMBER)
307     LIST(APPEND _${PROJECT_NAME}_exposed_targets renumbercpp)
308   ENDIF()
309   IF(SALOME_MED_ENABLE_PARTITIONER)
310     LIST(APPEND _${PROJECT_NAME}_exposed_targets medpartitionercpp)
311     IF(SALOME_BUILD_TESTS)
312       LIST(APPEND _${PROJECT_NAME}_exposed_targets MEDPARTITIONERTest)
313     ENDIF()
314   ENDIF()
315   IF(SALOME_BUILD_TESTS)
316     LIST(APPEND _${PROJECT_NAME}_exposed_targets InterpKernelTest)
317   ENDIF()
318 ENDIF()
319
320 IF(SALOME_USE_MPI)
321   LIST(APPEND _${PROJECT_NAME}_exposed_targets paramedmem)
322   IF(NOT SALOME_MED_MICROMED)
323     LIST(APPEND _${PROJECT_NAME}_exposed_targets paramedloader)
324   ENDIF()
325   IF(NOT SALOME_MED_STANDALONE)
326     LIST(APPEND _${PROJECT_NAME}_exposed_targets
327       paramedcouplingcorba paramedmemcompo)
328   ENDIF()
329   IF(SALOME_BUILD_TESTS)
330     IF(NOT SALOME_MED_MICROMED)
331       LIST(APPEND _${PROJECT_NAME}_exposed_targets ParaMEDMEMTest)
332     ENDIF()
333   ENDIF()
334 ENDIF()
335
336 IF(NOT SALOME_MED_STANDALONE)
337   LIST(APPEND _${PROJECT_NAME}_exposed_targets
338     SalomeIDLMED SalomeIDLMEDTests medcouplingcorba medcouplingclient)
339   IF(NOT SALOME_MED_MICROMED)
340     LIST(APPEND _${PROJECT_NAME}_exposed_targets medcalculator MEDFactoryEngine)
341     IF(SALOME_MED_ENABLE_PYTHON)
342       LIST(APPEND _${PROJECT_NAME}_exposed_targets medcalculatorspython)
343     ENDIF()
344   ENDIF()
345 ENDIF()
346
347 IF(SALOME_BUILD_GUI)
348   IF(NOT SALOME_MED_MICROMED)
349     LIST(APPEND _${PROJECT_NAME}_exposed_targets
350        MEDCALCGUI_dialogs MEDCALCGUI)
351   ENDIF()
352 ENDIF()
353
354 # Add all targets to the build-tree export set
355
356 EXPORT(TARGETS ${_${PROJECT_NAME}_exposed_targets}
357   FILE ${PROJECT_BINARY_DIR}/${PROJECT_NAME}Targets.cmake)
358
359 # Create the configuration files:
360 #   - in the build tree:
361
362 #      Ensure the variables are always defined for the configure (even if empty):
363 SET(KERNEL_ROOT_DIR "${KERNEL_ROOT_DIR}")
364 SET(GUI_ROOT_DIR "${GUI_ROOT_DIR}")
365 SET(MEDFILE_ROOT_DIR "${MEDFILE_ROOT_DIR}")
366 SET(MPI_ROOT_DIR "${MPI_ROOT_DIR}")
367 SET(HDF5_ROOT_DIR "${HDF5_ROOT_DIR}")
368 SET(OMNIORB_ROOT_DIR "${OMNIORB_ROOT_DIR}")
369 SET(PTHREAD_ROOT_DIR "${PTHREAD_ROOT_DIR}")
370 SET(BOOST_ROOT_DIR "${BOOST_ROOT_DIR}")
371 SET(SWIG_ROOT_DIR "${SWIG_ROOT_DIR}")
372 SET(PYTHON_ROOT_DIR "${PYTHON_ROOT_DIR}")
373 SET(CPPUNIT_ROOT_DIR "${CPPUNIT_ROOT_DIR}")
374 SET(GRAPHVIZ_ROOT_DIR "${GRAPHVIZ_ROOT_DIR}")
375 SET(DOXYGEN_ROOT_DIR "${DOXYGEN_ROOT_DIR}")
376 SET(SPHINX_ROOT_DIR "${SPHINX_ROOT_DIR}")
377
378 SET(METIS_ROOT_DIR "${METIS_ROOT_DIR}")
379 SET(PARMETIS_ROOT_DIR "${PARMETIS_ROOT_DIR}")
380 SET(SCOTCH_ROOT_DIR "${SCOTCH_ROOT_DIR}")
381 SET(XDR_ROOT_DIR "${XDR_ROOT_DIR}")
382
383 #   - in the install tree:
384 #       Get the relative path of the include directory so
385 #       we can register it in the generated configuration files:
386 SET(CONF_INCLUDE_DIRS "${CMAKE_INSTALL_PREFIX}/${INSTALL_INCLUDE_DIR}")
387
388 # Build variables that will be expanded when configuring Salome<MODULE>Config.cmake:
389 SALOME_CONFIGURE_PREPARE(Metis ParMetis Scotch XDR CAS Qt4 CppUnit Graphviz Doxygen Sphinx MPI omniORB
390                          PThread Boost libXml2 Python HDF5 MEDFile)
391
392 CONFIGURE_PACKAGE_CONFIG_FILE(${PROJECT_NAME}Config.cmake.in
393     ${PROJECT_BINARY_DIR}/to_install/${PROJECT_NAME}Config.cmake
394     INSTALL_DESTINATION "${SALOME_INSTALL_CMAKE}_LOCAL"
395     PATH_VARS CONF_INCLUDE_DIRS SALOME_INSTALL_CMAKE_LOCAL CMAKE_INSTALL_PREFIX
396        KERNEL_ROOT_DIR GUI_ROOT_DIR MEDFILE_ROOT_DIR MPI_ROOT_DIR
397        HDF5_ROOT_DIR OMNIORB_ROOT_DIR PTHREAD_ROOT_DIR BOOST_ROOT_DIR
398        SWIG_ROOT_DIR PYTHON_ROOT_DIR CPPUNIT_ROOT_DIR GRAPHVIZ_ROOT_DIR DOXYGEN_ROOT_DIR
399        SPHINX_ROOT_DIR METIS_ROOT_DIR PARMETIS_ROOT_DIR SCOTCH_ROOT_DIR XDR_ROOT_DIR)
400
401 WRITE_BASIC_PACKAGE_VERSION_FILE(${PROJECT_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake
402     VERSION ${${PROJECT_NAME_UC}_VERSION}
403     COMPATIBILITY AnyNewerVersion)
404
405 # Install the CMake configuration files:
406 INSTALL(FILES
407   "${PROJECT_BINARY_DIR}/to_install/${PROJECT_NAME}Config.cmake"
408   "${PROJECT_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake"
409   DESTINATION "${SALOME_INSTALL_CMAKE_LOCAL}")
410
411 # Install the export set for use with the install-tree
412 INSTALL(EXPORT ${PROJECT_NAME}TargetGroup DESTINATION "${SALOME_INSTALL_CMAKE_LOCAL}"
413         FILE ${PROJECT_NAME}Targets.cmake)