]> SALOME platform Git repositories - samples/calculator.git/blob - SalomeCALCULATORConfig.cmake.in
Salome HOME
Update tests
[samples/calculator.git] / SalomeCALCULATORConfig.cmake.in
1 # Copyright (C) 2013-2015  CEA/DEN, EDF R&D, OPEN CASCADE
2 #
3 # Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 # CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
5 #
6 # This library is free software; you can redistribute it and/or
7 # modify it under the terms of the GNU Lesser General Public
8 # License as published by the Free Software Foundation; either
9 # version 2.1 of the License, or (at your option) any later version.
10 #
11 # This library is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14 # Lesser General Public License for more details.
15 #
16 # You should have received a copy of the GNU Lesser General Public
17 # License along with this library; if not, write to the Free Software
18 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
19 #
20 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
21 #
22
23 # - Config file for the @PROJECT_NAME@ package
24 # It defines the following variables. 
25 # Specific to the pacakge @PROJECT_NAME@ itself:
26 #  @PROJECT_NAME_UC@_ROOT_DIR_EXP - the root path of the installation providing this CMake file
27 #
28
29 ### Initialisation performed by CONFIGURE_PACKAGE_CONFIG_FILE:
30 @PACKAGE_INIT@
31
32 # Load the dependencies for the libraries of @PROJECT_NAME@ 
33 # (contains definitions for IMPORTED targets). This is only 
34 # imported if we are not built as a subproject (in this case targets are already there)
35 IF(NOT TARGET CALCULATOREngine AND NOT @PROJECT_NAME@_BINARY_DIR)
36   INCLUDE("@PACKAGE_SALOME_INSTALL_CMAKE_LOCAL@/@PROJECT_NAME@Targets.cmake")
37 ENDIF()   
38
39 # Package root dir:
40 SET_AND_CHECK(CALCULATOR_ROOT_DIR_EXP "@PACKAGE_CMAKE_INSTALL_PREFIX@")
41
42 # Include directories
43 SET_AND_CHECK(CALCULATOR_INCLUDE_DIRS "${CALCULATOR_ROOT_DIR_EXP}/@SALOME_INSTALL_HEADERS@")
44 SET(CALCULATOR_INCLUDE_DIRS "${CALCULATOR_INCLUDE_DIRS};@_SalomeCALCULATOR_EXTRA_HEADERS@")
45 SET(CALCULATOR_DEFINITIONS "@MED_DEFINITIONS@")
46
47 # Package specific environment variables
48 @_SalomeCALCULATOR_EXTRA_ENV_FULL@
49
50 #### Now the specificities
51
52 # Options exported by the package:
53 SET(SALOME_CALCULATOR_BUILD_TESTS @SALOME_BUILD_TESTS@)
54 SET(SALOME_CALCULATOR_BUILD_DOC   @SALOME_BUILD_DOC@)
55
56 # Level 1 prerequisites:
57 SET_AND_CHECK(MED_ROOT_DIR_EXP  "@PACKAGE_MED_ROOT_DIR@")
58
59 # For all prerequisites, load the corresponding targets if the package was used
60 # in CONFIG mode. This ensures dependent projects link correctly
61 # without having to set LD_LIBRARY_PATH:
62 SET(_PREREQ_@PROJECT_NAME@ @_PREREQ_LIST@)
63 SET(_PREREQ_@PROJECT_NAME@_CONFIG_DIR @_PREREQ_DIR_LIST@)
64 SET(_PREREQ_@PROJECT_NAME@_COMPONENTS "@_PREREQ_COMPO_LIST@")
65 LIST(LENGTH _PREREQ_@PROJECT_NAME@_CONFIG_DIR _list_len_@PROJECT_NAME@)
66 IF(NOT _list_len_@PROJECT_NAME@ EQUAL 0)
67   # Another CMake stupidity - FOREACH(... RANGE r) generates r+1 numbers ...
68   MATH(EXPR _range_@PROJECT_NAME@ "${_list_len_@PROJECT_NAME@}-1")
69   FOREACH(_p_@PROJECT_NAME@ RANGE ${_range_@PROJECT_NAME@})
70     LIST(GET _PREREQ_@PROJECT_NAME@            ${_p_@PROJECT_NAME@} _pkg_@PROJECT_NAME@    )
71     LIST(GET _PREREQ_@PROJECT_NAME@_CONFIG_DIR ${_p_@PROJECT_NAME@} _pkg_dir_@PROJECT_NAME@)
72     LIST(GET _PREREQ_@PROJECT_NAME@_COMPONENTS ${_p_@PROJECT_NAME@} _pkg_compo_@PROJECT_NAME@)
73     IF(NOT OMIT_DETECT_PACKAGE_${_pkg_@PROJECT_NAME@})
74       MESSAGE(STATUS "===> Reloading targets from ${_pkg_@PROJECT_NAME@} ...")
75       IF(NOT _pkg_compo_@PROJECT_NAME@)
76         FIND_PACKAGE(${_pkg_@PROJECT_NAME@} REQUIRED NO_MODULE
77             PATHS "${_pkg_dir_@PROJECT_NAME@}"
78             NO_DEFAULT_PATH)
79       ELSE()
80         STRING(REPLACE "," ";" _compo_lst_@PROJECT_NAME@ "${_pkg_compo_@PROJECT_NAME@}")
81         MESSAGE(STATUS "===> (components: ${_pkg_compo_@PROJECT_NAME@})")
82         FIND_PACKAGE(${_pkg_@PROJECT_NAME@} REQUIRED NO_MODULE
83             COMPONENTS ${_compo_lst_@PROJECT_NAME@}
84             PATHS "${_pkg_dir_@PROJECT_NAME@}"
85             NO_DEFAULT_PATH)
86       ENDIF()
87     ENDIF()
88   ENDFOREACH()
89 ENDIF()
90
91 # Installation directories
92 SET(SALOME_INSTALL_BINS "@SALOME_INSTALL_BINS@")
93 SET(SALOME_INSTALL_LIBS "@SALOME_INSTALL_LIBS@")
94 SET(SALOME_INSTALL_IDLS "@SALOME_INSTALL_IDLS@")
95 SET(SALOME_INSTALL_HEADERS "@SALOME_INSTALL_HEADERS@")
96 SET(SALOME_INSTALL_SCRIPT_SCRIPTS "@SALOME_INSTALL_SCRIPT_SCRIPTS@")
97 SET(SALOME_INSTALL_SCRIPT_DATA "@SALOME_INSTALL_SCRIPT_DATA@")
98 SET(SALOME_INSTALL_SCRIPT_PYTHON "@SALOME_INSTALL_SCRIPT_PYTHON@")
99 SET(SALOME_INSTALL_APPLISKEL_SCRIPTS "@SALOME_INSTALL_APPLISKEL_SCRIPTS@")
100 SET(SALOME_INSTALL_APPLISKEL_PYTHON "@SALOME_INSTALL_APPLISKEL_PYTHON@") 
101 SET(SALOME_INSTALL_CMAKE_LOCAL "@SALOME_INSTALL_CMAKE_LOCAL@")
102 SET(SALOME_INSTALL_PYTHON "@SALOME_INSTALL_PYTHON@")
103 SET(SALOME_INSTALL_PYTHON_SHARED "@SALOME_INSTALL_PYTHON_SHARED@")
104 SET(SALOME_INSTALL_RES "@SALOME_INSTALL_RES@")
105 SET(SALOME_INSTALL_DOC "@SALOME_INSTALL_DOC@")
106 SET(SALOME_INSTALL_AMCONFIG_LOCAL "@SALOME_INSTALL_AMCONFIG_LOCAL@")
107
108 # Include MED targets if they were not already loaded:
109 IF(NOT (TARGET medcalculator)) 
110   INCLUDE("${MED_ROOT_DIR_EXP}/${SALOME_INSTALL_CMAKE}/SalomeMEDTargets.cmake")
111 ENDIF()
112
113 # Exposed CALCULATOR targets:
114 SET(CALCULATOR_CALCULATOREngine CALCULATOREngine)
115 SET(CALCULATOR_SalomeIDLCALCULATOR SalomeIDLCALCULATOR)