Salome HOME
1085e4a26b2b077401d97dfaf912b965ca536371
[tools/medcoupling.git] / MEDCouplingConfig.cmake.in
1 # - Config file for the @PROJECT_NAME@ package
2 # It defines the following variables. 
3 # Specific to the pacakge @PROJECT_NAME@ itself:
4 #  @PROJECT_NAME_UC@_ROOT_DIR_EXP - the root path of the installation providing this CMake file
5 #
6
7 ###############################################################
8 # Copyright (C) 2013-2015  CEA/DEN, EDF R&D, OPEN CASCADE
9 #
10 # This library is free software; you can redistribute it and/or
11 # modify it under the terms of the GNU Lesser General Public
12 # License as published by the Free Software Foundation; either
13 # version 2.1 of the License, or (at your option) any later version.
14 #
15 # This library is distributed in the hope that it will be useful,
16 # but WITHOUT ANY WARRANTY; without even the implied warranty of
17 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
18 # Lesser General Public License for more details.
19 #
20 # You should have received a copy of the GNU Lesser General Public
21 # License along with this library; if not, write to the Free Software
22 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
23 #
24 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
25 #
26
27 ### Initialisation performed by CONFIGURE_PACKAGE_CONFIG_FILE:
28 @PACKAGE_INIT@
29
30 # Load the dependencies for the libraries of @PROJECT_NAME@ 
31 # (contains definitions for IMPORTED targets). This is only 
32 # imported if we are not built as a subproject (in this case targets are already there)
33 IF(NOT TARGET medcoupling AND NOT @PROJECT_NAME@_BINARY_DIR)
34   INCLUDE("@PACKAGE_MEDCOUPLING_INSTALL_CMAKE_LOCAL@/@PROJECT_NAME@Targets.cmake")
35 ENDIF()   
36
37 # Package root dir:
38 SET_AND_CHECK(MEDCOUPLING_ROOT_DIR_EXP "@PACKAGE_CMAKE_INSTALL_PREFIX@")
39
40 # Include directories and definitions
41 SET_AND_CHECK(MEDCOUPLING_INCLUDE_DIRS "${MEDCOUPLING_ROOT_DIR_EXP}/@MEDCOUPLING_INSTALL_HEADERS@")
42 SET(MEDCOUPLING_INCLUDE_DIRS "${MEDCOUPLING_INCLUDE_DIRS};@_MEDCoupling_EXTRA_HEADERS@")
43 SET(MEDCOUPLING_DEFINITIONS)
44
45 # Package specific environment variables
46 @_MEDCoupling_EXTRA_ENV_FULL@
47
48 #### Now the specificities
49
50 # Options exported by the package:
51 SET(MEDCOUPLING_MED_MICROMED       @MEDCOUPLING_MED_MICROMED@)
52 SET(MEDCOUPLING_MED_ENABLE_PYTHON  @MEDCOUPLING_MED_ENABLE_PYTHON@)
53 SET(MEDCOUPLING_USE_MPI            @MEDCOUPLING_USE_MPI@)
54 SET(MEDCOUPLING_MED_BUILD_DOC      @MEDCOUPLING_MED_BUILD_DOC@)
55 SET(MEDCOUPLING_MED_BUILD_TESTS    @MEDCOUPLING_MED_BUILD_TESTS@)
56 SET(MEDCOUPLING_MED_BUILD_GUI      @MEDCOUPLING_MED_BUILD_GUI@)
57
58 # Advanced options
59
60 # Level 1 prerequisites:
61
62 # Optional level 1 prerequisites:
63
64 IF(NOT MEDCOUPLING_MED_MICROMED)
65   SET_AND_CHECK(MEDFILE_ROOT_DIR_EXP "@PACKAGE_MEDFILE_ROOT_DIR@")
66 ENDIF()
67
68 # For all prerequisites, load the corresponding targets if the package was used 
69 # in CONFIG mode. This ensures dependent projects link correctly
70 # without having to set LD_LIBRARY_PATH:
71 SET(_PREREQ @_PREREQ_LIST@)
72 SET(_PREREQ_CONFIG_DIR @_PREREQ_DIR_LIST@)
73 SET(_PREREQ_COMPONENTS "@_PREREQ_COMPO_LIST@")
74 LIST(LENGTH _PREREQ_CONFIG_DIR _list_len)
75 IF(NOT _list_len EQUAL 0)
76   # Another CMake stupidity - FOREACH(... RANGE r) generates r+1 numbers ...
77   MATH(EXPR _range "${_list_len}-1")
78   FOREACH(_p RANGE ${_range})  
79     LIST(GET _PREREQ            ${_p} _pkg    )
80     LIST(GET _PREREQ_CONFIG_DIR ${_p} _pkg_dir)
81     LIST(GET _PREREQ_COMPONENTS ${_p} _pkg_compo)
82     MESSAGE(STATUS "===> Reloading targets from ${_pkg} ...")
83     IF(NOT _pkg_compo)
84       FIND_PACKAGE(${_pkg} REQUIRED NO_MODULE 
85           PATHS "${_pkg_dir}" 
86           NO_DEFAULT_PATH)
87     ELSE()
88       STRING(REPLACE "," ";" _compo_lst "${_pkg_compo}")
89       MESSAGE(STATUS "===> (components: ${_pkg_compo})")
90       FIND_PACKAGE(${_pkg} REQUIRED NO_MODULE
91           COMPONENTS ${_compo_lst} 
92           PATHS "${_pkg_dir}"
93           NO_DEFAULT_PATH)
94     ENDIF()
95   ENDFOREACH()
96 ENDIF()
97
98 # Installation directories
99 SET(MEDCOUPLING_INSTALL_BINS "@MEDCOUPLING_INSTALL_BINS@")
100 SET(MEDCOUPLING_INSTALL_LIBS "@MEDCOUPLING_INSTALL_BINS@")
101 SET(MEDCOUPLING_INSTALL_HEADERS "@MEDCOUPLING_INSTALL_BINS@")
102 SET(MEDCOUPLING_INSTALL_SCRIPT_SCRIPTS "@MEDCOUPLING_INSTALL_BINS@")
103 SET(MEDCOUPLING_INSTALL_TESTS "@MEDCOUPLING_INSTALL_BINS@")
104 SET(MEDCOUPLING_INSTALL_SCRIPT_PYTHON "@MEDCOUPLING_INSTALL_BINS@")
105 SET(MEDCOUPLING_INSTALL_CMAKE_LOCAL "@MEDCOUPLING_INSTALL_BINS@")
106 IF(MEDCOUPLING_MED_ENABLE_PYTHON)
107   SET(MEDCOUPLING_INSTALL_PYTHON "@MEDCOUPLING_INSTALL_BINS@")
108   SET(MEDCOUPLING_INSTALL_PYTHON_SHARED "@MEDCOUPLING_INSTALL_BINS@")
109 ENDIF(MEDCOUPLING_MED_ENABLE_PYTHON)
110 SET(MEDCOUPLING_INSTALL_RES "@MEDCOUPLING_INSTALL_BINS@")
111 SET(MEDCOUPLING_INSTALL_DOC "@MEDCOUPLING_INSTALL_BINS@")
112
113 # Exposed MEDCoupling targets:
114 SET(MEDCoupling_interpkernel interpkernel)
115 SET(MEDCoupling_medcoupling medcoupling)
116 SET(MEDCoupling_medcouplingremapper medcouplingremapper)
117 SET(MEDCoupling_medloader medloader)
118 SET(MEDCoupling_renumbercpp renumbercpp)
119 SET(MEDCoupling_medpartitionercpp medpartitionercpp)
120 SET(MEDCoupling_MEDPARTITIONERTest MEDPARTITIONERTest)
121 SET(MEDCoupling_InterpKernelTest InterpKernelTest)
122 SET(MEDCoupling_paramedmem paramedmem)
123 SET(MEDCoupling_paramedloader paramedloader)
124 SET(MEDCoupling_paramedmemcompo paramedmemcompo)
125 SET(MEDCoupling_ParaMEDMEMTest ParaMEDMEMTest)
126 SET(MEDCoupling_medcouplingclient medcouplingclient)