]> SALOME platform Git repositories - samples/hello.git/blob - SalomeHELLOConfig.cmake.in
Salome HOME
57009bbe2f6431dcaeb1a4743590fcc00d261ba3
[samples/hello.git] / SalomeHELLOConfig.cmake.in
1 # Copyright (C) 2013-2019  CEA/DEN, EDF R&D, OPEN CASCADE
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 # - Config file for the @PROJECT_NAME@ package
21 # It defines the following variables. 
22 # Specific to the pacakge @PROJECT_NAME@ itself:
23 #  @PROJECT_NAME_UC@_ROOT_DIR_EXP - the root path of the installation providing this CMake file
24 #
25
26 ### Initialisation performed by CONFIGURE_PACKAGE_CONFIG_FILE:
27 @PACKAGE_INIT@
28
29 # Load the dependencies for the libraries of @PROJECT_NAME@ 
30 # (contains definitions for IMPORTED targets). This is only 
31 # imported if we are not built as a subproject (in this case targets are already there)
32 IF(NOT TARGET HELLOEngine AND NOT @PROJECT_NAME@_BINARY_DIR)
33   INCLUDE("@PACKAGE_SALOME_INSTALL_CMAKE_LOCAL@/@PROJECT_NAME@Targets.cmake")
34 ENDIF()
35
36 # Package root dir:
37 SET_AND_CHECK(HELLO_ROOT_DIR_EXP "@PACKAGE_CMAKE_INSTALL_PREFIX@")
38
39 # Include directories
40 SET_AND_CHECK(HELLO_INCLUDE_DIRS "${HELLO_ROOT_DIR_EXP}/@SALOME_INSTALL_HEADERS@")
41 SET(HELLO_INCLUDE_DIRS "${HELLO_INCLUDE_DIRS};@_SalomeHELLO_EXTRA_HEADERS@")
42 SET(HELLO_DEFINITIONS "@GUI_DEFINITIONS@")
43
44 # Package specific environment variables
45 @_SalomeHELLO_EXTRA_ENV_FULL@
46
47 #### Now the specificities
48
49 # Options exported by the package:
50 SET(SALOME_HELLO_BUILD_TESTS @SALOME_BUILD_TESTS@)
51 SET(SALOME_HELLO_BUILD_DOC   @SALOME_BUILD_DOC@)
52
53 # Level 1 prerequisites:
54 SET_AND_CHECK(GUI_ROOT_DIR_EXP "@PACKAGE_GUI_ROOT_DIR@")
55
56 # For all prerequisites, load the corresponding targets if the package was used
57 # in CONFIG mode. This ensures dependent projects link correctly
58 # without having to set LD_LIBRARY_PATH:
59 SET(_PREREQ_@PROJECT_NAME@ @_PREREQ_LIST@)
60 SET(_PREREQ_@PROJECT_NAME@_CONFIG_DIR @_PREREQ_DIR_LIST@)
61 SET(_PREREQ_@PROJECT_NAME@_COMPONENTS "@_PREREQ_COMPO_LIST@")
62 LIST(LENGTH _PREREQ_@PROJECT_NAME@_CONFIG_DIR _list_len_@PROJECT_NAME@)
63 IF(NOT _list_len_@PROJECT_NAME@ EQUAL 0)
64   # Another CMake stupidity - FOREACH(... RANGE r) generates r+1 numbers ...
65   MATH(EXPR _range_@PROJECT_NAME@ "${_list_len_@PROJECT_NAME@}-1")
66   FOREACH(_p_@PROJECT_NAME@ RANGE ${_range_@PROJECT_NAME@})
67     LIST(GET _PREREQ_@PROJECT_NAME@            ${_p_@PROJECT_NAME@} _pkg_@PROJECT_NAME@    )
68     LIST(GET _PREREQ_@PROJECT_NAME@_CONFIG_DIR ${_p_@PROJECT_NAME@} _pkg_dir_@PROJECT_NAME@)
69     LIST(GET _PREREQ_@PROJECT_NAME@_COMPONENTS ${_p_@PROJECT_NAME@} _pkg_compo_@PROJECT_NAME@)
70     IF(NOT OMIT_DETECT_PACKAGE_${_pkg_@PROJECT_NAME@})
71       MESSAGE(STATUS "===> Reloading targets from ${_pkg_@PROJECT_NAME@} ...")
72       IF(NOT _pkg_compo_@PROJECT_NAME@)
73         FIND_PACKAGE(${_pkg_@PROJECT_NAME@} REQUIRED NO_MODULE
74             PATHS "${_pkg_dir_@PROJECT_NAME@}"
75             NO_DEFAULT_PATH)
76       ELSE()
77         STRING(REPLACE "," ";" _compo_lst_@PROJECT_NAME@ "${_pkg_compo_@PROJECT_NAME@}")
78         MESSAGE(STATUS "===> (components: ${_pkg_compo_@PROJECT_NAME@})")
79         FIND_PACKAGE(${_pkg_@PROJECT_NAME@} REQUIRED NO_MODULE
80             COMPONENTS ${_compo_lst_@PROJECT_NAME@}
81             PATHS "${_pkg_dir_@PROJECT_NAME@}"
82             NO_DEFAULT_PATH)
83       ENDIF()
84     ENDIF()
85   ENDFOREACH()
86 ENDIF()
87
88 # Installation directories
89 SET(SALOME_INSTALL_BINS "@SALOME_INSTALL_BINS@")
90 SET(SALOME_INSTALL_LIBS "@SALOME_INSTALL_LIBS@")
91 SET(SALOME_INSTALL_IDLS "@SALOME_INSTALL_IDLS@")
92 SET(SALOME_INSTALL_HEADERS "@SALOME_INSTALL_HEADERS@")
93 SET(SALOME_INSTALL_SCRIPT_SCRIPTS "@SALOME_INSTALL_SCRIPT_SCRIPTS@")
94 SET(SALOME_INSTALL_SCRIPT_DATA "@SALOME_INSTALL_SCRIPT_DATA@")
95 SET(SALOME_INSTALL_SCRIPT_PYTHON "@SALOME_INSTALL_SCRIPT_PYTHON@")
96 SET(SALOME_INSTALL_APPLISKEL_SCRIPTS "@SALOME_INSTALL_APPLISKEL_SCRIPTS@")
97 SET(SALOME_INSTALL_APPLISKEL_PYTHON "@SALOME_INSTALL_APPLISKEL_PYTHON@") 
98 SET(SALOME_INSTALL_CMAKE_LOCAL "@SALOME_INSTALL_CMAKE_LOCAL@")
99 SET(SALOME_INSTALL_PYTHON "@SALOME_INSTALL_PYTHON@")
100 SET(SALOME_INSTALL_PYTHON_SHARED "@SALOME_INSTALL_PYTHON_SHARED@")
101 SET(SALOME_INSTALL_RES "@SALOME_INSTALL_RES@")
102 SET(SALOME_INSTALL_DOC "@SALOME_INSTALL_DOC@")
103 SET(SALOME_INSTALL_AMCONFIG_LOCAL "@SALOME_INSTALL_AMCONFIG_LOCAL@")
104
105 # Include GUI targets if they were not already loaded:
106 IF(NOT (TARGET Event)) 
107   INCLUDE("${GUI_ROOT_DIR_EXP}/${SALOME_INSTALL_CMAKE}/SalomeGUITargets.cmake")
108 ENDIF()
109
110 # Exposed HELLO targets:
111 SET(HELLO_HELLOEngine HELLOEngine)
112 SET(HELLO_HELLO HELLO)
113 SET(HELLO_SalomeIDLHELLO SalomeIDLHELLO)