Salome HOME
Copyright update: 2016
[modules/smesh.git] / SalomeSMESHConfig.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) 2007-2016  CEA/DEN, EDF R&D, OPEN CASCADE
9 #
10 # Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
11 # CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
12 #
13 # This library is free software; you can redistribute it and/or
14 # modify it under the terms of the GNU Lesser General Public
15 # License as published by the Free Software Foundation; either
16 # version 2.1 of the License, or (at your option) any later version.
17 #
18 # This library is distributed in the hope that it will be useful,
19 # but WITHOUT ANY WARRANTY; without even the implied warranty of
20 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
21 # Lesser General Public License for more details.
22 #
23 # You should have received a copy of the GNU Lesser General Public
24 # License along with this library; if not, write to the Free Software
25 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
26 #
27 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
28 #
29
30 ### Initialisation performed by CONFIGURE_PACKAGE_CONFIG_FILE:
31 @PACKAGE_INIT@
32
33 # Load the dependencies for the libraries of @PROJECT_NAME@ 
34 # (contains definitions for IMPORTED targets). This is only 
35 # imported if we are not built as a subproject (in this case targets are already there)
36 IF(NOT TARGET SMESHEngine AND NOT @PROJECT_NAME@_BINARY_DIR)
37   INCLUDE("@PACKAGE_SALOME_INSTALL_CMAKE_LOCAL@/@PROJECT_NAME@Targets.cmake")
38 ENDIF()   
39
40 # Package root dir:
41 SET_AND_CHECK(SMESH_ROOT_DIR_EXP "@PACKAGE_CMAKE_INSTALL_PREFIX@")
42
43 # Include directories
44 SET_AND_CHECK(SMESH_INCLUDE_DIRS "${SMESH_ROOT_DIR_EXP}/@SALOME_INSTALL_HEADERS@")
45 SET(SMESH_INCLUDE_DIRS "${SMESH_INCLUDE_DIRS};@_SalomeSMESH_EXTRA_HEADERS@")
46 SET(SMESH_DEFINITIONS "@GEOM_DEFINITIONS@")
47
48 # Package specific environment variables
49 @_SalomeSMESH_EXTRA_ENV_FULL@
50
51 #### Now the specificities
52
53 # Options exported by the package:
54 SET(SALOME_SMESH_BUILD_DOC @SALOME_BUILD_DOC@)
55 SET(SALOME_SMESH_BUILD_TESTS @SALOME_BUILD_TESTS@)
56
57 # Advanced options
58 SET(SALOME_SMESH_BUILD_GUI @SALOME_BUILD_GUI@)
59 SET(SALOME_SMESH_USE_CGNS  @SALOME_SMESH_USE_CGNS@)
60 SET(SALOME_SMESH_USE_TBB   @SALOME_SMESH_USE_TBB@)
61 SET(SALOME_SMESH_ENABLE_MEFISTO   @SALOME_SMESH_ENABLE_MEFISTO@)
62 IF(NOT WIN32)
63   LIST(APPEND SMESH_DEFINITIONS "-DENABLE_MEFISTO")
64 ENDIF(NOT WIN32)
65
66 # Level 1 prerequisites:
67 SET_AND_CHECK(GEOM_ROOT_DIR_EXP "@PACKAGE_GEOM_ROOT_DIR@")
68 SET_AND_CHECK(MEDFILE_ROOT_DIR_EXP "@PACKAGE_MEDFILE_ROOT_DIR@")
69
70 # Optional level 1 prerequisites:
71 IF(SALOME_SMESH_USE_CGNS)
72   SET_AND_CHECK(CGNS_ROOT_DIR_EXP "@PACKAGE_CGNS_ROOT_DIR@")
73 ENDIF()
74 IF(SALOME_SMESH_USE_TBB)
75   SET_AND_CHECK(TBB_ROOT_DIR_EXP "@PACKAGE_TBB_ROOT_DIR@")
76 ENDIF()
77
78 # For all prerequisites, load the corresponding targets if the package was used
79 # in CONFIG mode. This ensures dependent projects link correctly
80 # without having to set LD_LIBRARY_PATH:
81 SET(_PREREQ_@PROJECT_NAME@ @_PREREQ_LIST@)
82 SET(_PREREQ_@PROJECT_NAME@_CONFIG_DIR @_PREREQ_DIR_LIST@)
83 SET(_PREREQ_@PROJECT_NAME@_COMPONENTS "@_PREREQ_COMPO_LIST@")
84 LIST(LENGTH _PREREQ_@PROJECT_NAME@_CONFIG_DIR _list_len_@PROJECT_NAME@)
85 IF(NOT _list_len_@PROJECT_NAME@ EQUAL 0)
86   # Another CMake stupidity - FOREACH(... RANGE r) generates r+1 numbers ...
87   MATH(EXPR _range_@PROJECT_NAME@ "${_list_len_@PROJECT_NAME@}-1")
88   FOREACH(_p_@PROJECT_NAME@ RANGE ${_range_@PROJECT_NAME@})
89     LIST(GET _PREREQ_@PROJECT_NAME@            ${_p_@PROJECT_NAME@} _pkg_@PROJECT_NAME@    )
90     LIST(GET _PREREQ_@PROJECT_NAME@_CONFIG_DIR ${_p_@PROJECT_NAME@} _pkg_dir_@PROJECT_NAME@)
91     LIST(GET _PREREQ_@PROJECT_NAME@_COMPONENTS ${_p_@PROJECT_NAME@} _pkg_compo_@PROJECT_NAME@)
92     IF(NOT OMIT_DETECT_PACKAGE_${_pkg_@PROJECT_NAME@})
93       MESSAGE(STATUS "===> Reloading targets from ${_pkg_@PROJECT_NAME@} ...")
94       IF(NOT _pkg_compo_@PROJECT_NAME@)
95         FIND_PACKAGE(${_pkg_@PROJECT_NAME@} REQUIRED NO_MODULE
96             PATHS "${_pkg_dir_@PROJECT_NAME@}"
97             NO_DEFAULT_PATH)
98       ELSE()
99         STRING(REPLACE "," ";" _compo_lst_@PROJECT_NAME@ "${_pkg_compo_@PROJECT_NAME@}")
100         MESSAGE(STATUS "===> (components: ${_pkg_compo_@PROJECT_NAME@})")
101         FIND_PACKAGE(${_pkg_@PROJECT_NAME@} REQUIRED NO_MODULE
102             COMPONENTS ${_compo_lst_@PROJECT_NAME@}
103             PATHS "${_pkg_dir_@PROJECT_NAME@}"
104             NO_DEFAULT_PATH)
105       ENDIF()
106     ENDIF()
107   ENDFOREACH()
108 ENDIF()
109
110 # Installation directories
111 SET(SALOME_INSTALL_BINS "@SALOME_INSTALL_BINS@")
112 SET(SALOME_INSTALL_LIBS "@SALOME_INSTALL_LIBS@")
113 SET(SALOME_INSTALL_IDLS "@SALOME_INSTALL_IDLS@")
114 SET(SALOME_INSTALL_HEADERS "@SALOME_INSTALL_HEADERS@")
115 SET(SALOME_INSTALL_SCRIPT_SCRIPTS "@SALOME_INSTALL_SCRIPT_SCRIPTS@")
116 SET(SALOME_INSTALL_SCRIPT_DATA "@SALOME_INSTALL_SCRIPT_DATA@")
117 SET(SALOME_INSTALL_SCRIPT_PYTHON "@SALOME_INSTALL_SCRIPT_PYTHON@")
118 SET(SALOME_INSTALL_APPLISKEL_SCRIPTS "@SALOME_INSTALL_APPLISKEL_SCRIPTS@")
119 SET(SALOME_INSTALL_APPLISKEL_PYTHON "@SALOME_INSTALL_APPLISKEL_PYTHON@") 
120 SET(SALOME_INSTALL_CMAKE_LOCAL "@SALOME_INSTALL_CMAKE_LOCAL@")
121 SET(SALOME_INSTALL_PYTHON "@SALOME_INSTALL_PYTHON@")
122 SET(SALOME_INSTALL_PYTHON_SHARED "@SALOME_INSTALL_PYTHON_SHARED@")
123 SET(SALOME_INSTALL_RES "@SALOME_INSTALL_RES@")
124 SET(SALOME_INSTALL_DOC "@SALOME_INSTALL_DOC@")
125 SET(SALOME_INSTALL_AMCONFIG_LOCAL "@SALOME_INSTALL_AMCONFIG_LOCAL@")
126
127 # Include GEOM targets if they were not already loaded:
128 IF(NOT (TARGET GEOMbasic))
129   INCLUDE("${GEOM_ROOT_DIR_EXP}/${SALOME_INSTALL_CMAKE_LOCAL}/SalomeGEOMTargets.cmake")
130 ENDIF(NOT (TARGET GEOMbasic))
131
132 # Exposed SMESH targets:
133 SET(SMESH_SMESHControls SMESHControls)
134 SET(SMESH_MeshDriver MeshDriver)
135 SET(SMESH_MeshDriverCGNS MeshDriverCGNS)
136 SET(SMESH_MeshDriverDAT MeshDriverDAT)
137 SET(SMESH_MeshDriverGMF MeshDriverGMF)
138 SET(SMESH_MeshDriverMED MeshDriverMED)
139 SET(SMESH_MeshDriverSTL MeshDriverSTL)
140 SET(SMESH_MeshDriverUNV MeshDriverUNV)
141 SET(SMESH_MEDWrapperBase MEDWrapperBase)
142 SET(SMESH_MEDWrapper MEDWrapper)
143 SET(SMESH_MEDWrapper_V2_2 MEDWrapper_V2_2)
144 IF(SALOME_SMESH_ENABLE_MEFISTO)
145   SET(SMESH_MEFISTO2D MEFISTO2D)
146 ENDIF(SALOME_SMESH_ENABLE_MEFISTO)
147 SET(SMESH_SMESHObject SMESHObject)
148 SET(SMESH_GeomSelectionTools GeomSelectionTools)
149 SET(SMESH_SMDS SMDS)
150 SET(SMESH_SMESHimpl SMESHimpl)
151 SET(SMESH_SMESHEngine SMESHEngine)
152 SET(SMESH_SMESHClient SMESHClient)
153 SET(SMESH_SMESHDS SMESHDS)
154 SET(SMESH_SMESHFiltersSelection SMESHFiltersSelection)
155 SET(SMESH_SMESH SMESH)
156 SET(SMESH_SMESHUtils SMESHUtils)
157 SET(SMESH_StdMeshers StdMeshers)
158 SET(SMESH_StdMeshersEngine StdMeshersEngine)
159 SET(SMESH_StdMeshersGUI StdMeshersGUI)
160 SET(SMESH_MeshJobManagerEngine MeshJobManagerEngine)
161 SET(SMESH_SPADDERPluginTesterEngine SPADDERPluginTesterEngine)
162 SET(SMESH_SalomeIDLSMESH SalomeIDLSMESH)
163 SET(SMESH_SalomeIDLSPADDER SalomeIDLSPADDER)