]> SALOME platform Git repositories - modules/shaper_study.git/blob - SalomeSHAPERSTUDYConfig.cmake.in
Salome HOME
b1f70ad7c5540627d7eefd9c8aa4fbbb00c5264a
[modules/shaper_study.git] / SalomeSHAPERSTUDYConfig.cmake.in
1 ###############################################################
2 # Copyright (C) 2007-2019  CEA/DEN, EDF R&D, OPEN CASCADE
3 #
4 # Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
5 # CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
6 #
7 # This library is free software; you can redistribute it and/or
8 # modify it under the terms of the GNU Lesser General Public
9 # License as published by the Free Software Foundation; either
10 # version 2.1 of the License, or (at your option) any later version.
11 #
12 # This library is distributed in the hope that it will be useful,
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
15 # Lesser General Public License for more details.
16 #
17 # You should have received a copy of the GNU Lesser General Public
18 # License along with this library; if not, write to the Free Software
19 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
20 #
21 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
22 #
23
24 # - Config file for the @PROJECT_NAME@ package
25 # It defines the following variables. 
26 # Specific to the pacakge @PROJECT_NAME@ itself:
27 #  @PROJECT_NAME_UC@_ROOT_DIR_EXP - the root path of the installation providing this CMake file
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 SalomeIDLSHAPERSTUDY 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(SHAPERSTUDY_ROOT_DIR_EXP "@PACKAGE_CMAKE_INSTALL_PREFIX@")
42
43 # Include directories
44 SET_AND_CHECK(SHAPERSTUDY_INCLUDE_DIRS "${SHAPERSTUDY_ROOT_DIR_EXP}/@SALOME_INSTALL_HEADERS@")
45 SET(SHAPERSTUDY_INCLUDE_DIRS "${SHAPERSTUDY_INCLUDE_DIRS};@_SalomeSHAPERSTUDY_EXTRA_HEADERS@")
46 SET(SHAPERSTUDY_DEFINITIONS "@GEOM_DEFINITIONS@")
47
48 # Package specific environment variables
49 @_SalomeSHAPERSTUDY_EXTRA_ENV_FULL@
50
51 #### Now the specificities
52
53 # Options exported by the package:
54 SET(SALOME_SHAPERSTUDY_BUILD_TESTS @SALOME_BUILD_TESTS@)
55 # TODO: documentation
56 # SET(SALOME_SHAPERSTUDY_BUILD_DOC   @SALOME_BUILD_DOC@)
57
58 # Level 1 prerequisites:
59 SET_AND_CHECK(GEOM_ROOT_DIR_EXP "@PACKAGE_GEOM_ROOT_DIR@")
60 SET_AND_CHECK(SHAPER_ROOT_DIR_EXP "@PACKAGE_SHAPER_ROOT_DIR@")
61
62 # For all prerequisites, load the corresponding targets if the package was used
63 # in CONFIG mode. This ensures dependent projects link correctly
64 # without having to set LD_LIBRARY_PATH:
65 SET(_PREREQ_@PROJECT_NAME@ @_PREREQ_LIST@)
66 SET(_PREREQ_@PROJECT_NAME@_CONFIG_DIR @_PREREQ_DIR_LIST@)
67 SET(_PREREQ_@PROJECT_NAME@_COMPONENTS "@_PREREQ_COMPO_LIST@")
68 LIST(LENGTH _PREREQ_@PROJECT_NAME@_CONFIG_DIR _list_len_@PROJECT_NAME@)
69 IF(NOT _list_len_@PROJECT_NAME@ EQUAL 0)
70   # Another CMake stupidity - FOREACH(... RANGE r) generates r+1 numbers ...
71   MATH(EXPR _range_@PROJECT_NAME@ "${_list_len_@PROJECT_NAME@}-1")
72   FOREACH(_p_@PROJECT_NAME@ RANGE ${_range_@PROJECT_NAME@})
73     LIST(GET _PREREQ_@PROJECT_NAME@            ${_p_@PROJECT_NAME@} _pkg_@PROJECT_NAME@    )
74     LIST(GET _PREREQ_@PROJECT_NAME@_CONFIG_DIR ${_p_@PROJECT_NAME@} _pkg_dir_@PROJECT_NAME@)
75     LIST(GET _PREREQ_@PROJECT_NAME@_COMPONENTS ${_p_@PROJECT_NAME@} _pkg_compo_@PROJECT_NAME@)
76     IF(NOT OMIT_DETECT_PACKAGE_${_pkg_@PROJECT_NAME@})
77       MESSAGE(STATUS "===> Reloading targets from ${_pkg_@PROJECT_NAME@} ...")
78       IF(NOT _pkg_compo_@PROJECT_NAME@)
79         FIND_PACKAGE(${_pkg_@PROJECT_NAME@} REQUIRED NO_MODULE
80             PATHS "${_pkg_dir_@PROJECT_NAME@}"
81             NO_DEFAULT_PATH)
82       ELSE()
83         STRING(REPLACE "," ";" _compo_lst_@PROJECT_NAME@ "${_pkg_compo_@PROJECT_NAME@}")
84         MESSAGE(STATUS "===> (components: ${_pkg_compo_@PROJECT_NAME@})")
85         FIND_PACKAGE(${_pkg_@PROJECT_NAME@} REQUIRED NO_MODULE
86             COMPONENTS ${_compo_lst_@PROJECT_NAME@}
87             PATHS "${_pkg_dir_@PROJECT_NAME@}"
88             NO_DEFAULT_PATH)
89       ENDIF()
90     ENDIF()
91   ENDFOREACH()
92 ENDIF()
93
94 # Include GEOM targets if they were not already loaded:
95 IF(NOT (TARGET GEOMbasic))
96   INCLUDE("${GEOM_ROOT_DIR_EXP}/${SALOME_INSTALL_CMAKE_LOCAL}/SalomeGEOMTargets.cmake")
97 ENDIF(NOT (TARGET GEOMbasic))
98 # TODO: Include SHAPER targets, as soon as config file's support is implemented in SHAPER
99
100 # Exposed SHAPERSTUDY targets:
101 SET(SHAPERSTUDY_SalomeIDLSHAPERSTUDY SalomeIDLSHAPERSTUDY)
102 SET(SHAPERSTUDY_StudyData StudyData)