]> Creatis software - crea.git/blob - cmake/InstallLibraryForCMake_LibraryConfig.cmake.in
Feature #1763
[crea.git] / cmake / InstallLibraryForCMake_LibraryConfig.cmake.in
1 # ---------------------------------------------------------------------
2 #
3 # Copyright (c) CREATIS (Centre de Recherche en Acquisition et Traitement de l'Image 
4 #                        pour la Santé)
5 # Authors : Eduardo Davila, Frederic Cervenansky, Claire Mouton
6 #
7 #  This software is governed by the CeCILL-B license under French law and 
8 #  abiding by the rules of distribution of free software. You can  use, 
9 #  modify and/ or redistribute the software under the terms of the CeCILL-B 
10 #  license as circulated by CEA, CNRS and INRIA at the following URL 
11 #  http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html 
12 #  or in the file LICENSE.txt.
13 #
14 #  As a counterpart to the access to the source code and  rights to copy,
15 #  modify and redistribute granted by the license, users are provided only
16 #  with a limited warranty  and the software's author,  the holder of the
17 #  economic rights,  and the successive licensors  have only  limited
18 #  liability. 
19 #
20 #  The fact that you are presently reading this means that you have had
21 #  knowledge of the CeCILL-B license and that you accept its terms.
22 # ------------------------------------------------------------------------ */ 
23
24
25 #-----------------------------------------------------------------------------
26 #
27 # @LIBRARY_NAME@Config.cmake - CMake configuration file for external projects.
28 # This file was automatically generated by the cmake macro 
29 # CREA_INSTALL_LIBRARY_FOR_CMAKE of the package CREA
30 #
31 # This file is configured by cmake and used by the
32 # Use@LIBRARY_NAME@.cmake module to load the lib settings 
33 # for an external project.
34
35 # Build tree config ?
36 SET(CILC_BUILD_TREE_CONFIGURATION @CILC_BUILD_TREE_CONFIGURATION@)
37
38
39 IF(UNIX)
40 SET(GOTO_INSTALL_PREFIX /../../..)
41 ENDIF(UNIX)
42
43
44 # The @LIBRARY_NAME@ include file *RELATIVE* directories.
45 SET(CILC_RELATIVE_INCLUDE_PATHS "@CILC_LIB_RELATIVE_INCLUDE_PATHS@")
46 # Compute the prefix for include and library paths
47 IF(CILC_BUILD_TREE_CONFIGURATION)
48   # In build tree 
49   # the include paths are relative to the source tree *AND* the binary tree 
50   # for generated files 
51   SET(CILC_INCLUDE_PATH_PREFIX @PROJECT_SOURCE_DIR@)
52   # Build the *ABSOLUTE* directories
53   FOREACH(path ${CILC_RELATIVE_INCLUDE_PATHS})
54     SET(@LIBRARY_NAME@_INCLUDE_DIRS
55       ${@LIBRARY_NAME@_INCLUDE_DIRS}
56       ${CILC_INCLUDE_PATH_PREFIX}/${path}
57       )
58   ENDFOREACH(path ${CILC_RELATIVE_INCLUDE_PATHS})
59   SET(CILC_INCLUDE_PATH_PREFIX @PROJECT_BINARY_DIR@)
60   # Build the *ABSOLUTE* directories
61   FOREACH(path ${CILC_RELATIVE_INCLUDE_PATHS})
62     SET(@LIBRARY_NAME@_INCLUDE_DIRS
63       ${@LIBRARY_NAME@_INCLUDE_DIRS}
64       ${CILC_INCLUDE_PATH_PREFIX}/${path}
65       )
66   ENDFOREACH(path ${CILC_RELATIVE_INCLUDE_PATHS})
67 ELSE(CILC_BUILD_TREE_CONFIGURATION)
68   # In install tree 
69   # the include paths are relative to install prefix 
70   # On unix , GOTO_INSTALL_PREFIX allows to get back to the 
71   # installation prefix from  @LIBRARY_NAME@_DIR
72   SET(CILC_INCLUDE_PATH_PREFIX ${@LIBRARY_NAME@_DIR}${GOTO_INSTALL_PREFIX})
73   # Build the *ABSOLUTE* directories
74   FOREACH(path ${CILC_RELATIVE_INCLUDE_PATHS})
75     SET(@LIBRARY_NAME@_INCLUDE_DIRS
76       ${@LIBRARY_NAME@_INCLUDE_DIRS}
77       ${CILC_INCLUDE_PATH_PREFIX}/${path}
78       )
79   ENDFOREACH(path ${CILC_RELATIVE_INCLUDE_PATHS})
80 ENDIF(CILC_BUILD_TREE_CONFIGURATION)
81
82
83
84 # Compute the prefix for library paths
85 IF(CILC_BUILD_TREE_CONFIGURATION)
86   # In build tree
87   # the library paths are relative to the binary tree 
88   SET(CILC_LIBRARY_PATH_PREFIX @PROJECT_BINARY_DIR@)
89 ELSE(CILC_BUILD_TREE_CONFIGURATION)
90   # In install tree 
91   # the library paths are relative to install prefix
92   SET(CILC_LIBRARY_PATH_PREFIX ${@LIBRARY_NAME@_DIR}${GOTO_INSTALL_PREFIX})
93 ENDIF(CILC_BUILD_TREE_CONFIGURATION)
94 # The @LIBRARY_NAME@ library file *RELATIVE* directories.
95 SET(CILC_RELATIVE_LIBRARY_PATHS "@CILC_LIB_RELATIVE_LIBRARY_PATHS@")
96 # Build the *ABSOLUTE* directories
97 FOREACH(path ${CILC_RELATIVE_LIBRARY_PATHS})
98   SET(@LIBRARY_NAME@_LIBRARY_DIRS
99     ${@LIBRARY_NAME@_LIBRARY_DIRS}
100     ${CILC_LIBRARY_PATH_PREFIX}/${path}
101     )
102 ENDFOREACH(path ${CILC_RELATIVE_LIBRARY_PATHS})
103
104 # Set the "prefix path"
105 SET(@LIBRARY_NAME@_INSTALL_PREFIX ${CILC_LIBRARY_PATH_PREFIX})
106
107 # The C and C++ flags added by @LIBRARY_NAME@ to the cmake-configured flags.
108 SET(@LIBRARY_NAME@_REQUIRED_C_FLAGS "@CILC_LIB_REQUIRED_C_FLAGS@")
109 SET(@LIBRARY_NAME@_REQUIRED_CXX_FLAGS "@CILC_LIB_REQUIRED_CXX_FLAGS@")
110 SET(@LIBRARY_NAME@_REQUIRED_LINK_FLAGS "@CILC_LIB_REQUIRED_LINK_FLAGS@")
111
112 # The @LIBRARY_NAME@ version 
113 SET(@LIBRARY_NAME@_MAJOR_VERSION @CILC_LIB_MAJOR_VERSION@)
114 SET(@LIBRARY_NAME@_MINOR_VERSION @CILC_LIB_MINOR_VERSION@)
115 SET(@LIBRARY_NAME@_BUILD_VERSION @CILC_LIB_BUILD_VERSION@)
116 SET(@LIBRARY_NAME@_VERSION @CILC_LIB_VERSION@)
117
118 # The location of the Use@LIBRARY_NAME@.cmake file.
119 SET(@LIBRARY_NAME@_USE_FILE "${@LIBRARY_NAME@_DIR}/Use@LIBRARY_NAME@.cmake")
120
121 # The build settings file.
122 SET(@LIBRARY_NAME@_BUILD_SETTINGS_FILE 
123   "${@LIBRARY_NAME@_DIR}/@LIBRARY_NAME@BuildSettings.cmake")
124
125 # A list of all libraries for @LIBRARY_NAME@.  Those listed here should
126 # automatically pull in their dependencies.
127 SET(@LIBRARY_NAME@_LIBRARIES @CILC_LIB_LIBRARIES@)
128
129 # Messages
130 IF(CREA_VERBOSE_CMAKE)
131   MESSAGE(STATUS "=======================================")
132   MESSAGE(STATUS "Looking for @LIBRARY_NAME@... found:")
133   MESSAGE(STATUS "* @LIBRARY_NAME@_DIR          = ${@LIBRARY_NAME@_DIR}")
134   MESSAGE(STATUS "* @LIBRARY_NAME@_VERSION      = ${@LIBRARY_NAME@_VERSION}")
135   MESSAGE(STATUS "* @LIBRARY_NAME@_USE_FILE     = ${@LIBRARY_NAME@_USE_FILE}")
136
137   MESSAGE(STATUS "* @LIBRARY_NAME@_INCLUDE_DIRS = ${@LIBRARY_NAME@_INCLUDE_DIRS}")
138   MESSAGE(STATUS "* @LIBRARY_NAME@_LIBRARY_DIRS = ${@LIBRARY_NAME@_LIBRARY_DIRS}")
139   MESSAGE(STATUS "* @LIBRARY_NAME@_LIBRARIES    = ${@LIBRARY_NAME@_LIBRARIES}")
140 ENDIF(CREA_VERBOSE_CMAKE)
141
142 # Does the library has an additional config file (user provided) ?
143 SET(@LIBRARY_NAME@_HAS_ADDITIONAL_CONFIG_FILE @CILC_LIB_HAS_ADDITIONAL_CONFIG_FILE@)
144
145 IF (@LIBRARY_NAME@_HAS_ADDITIONAL_CONFIG_FILE)
146   IF(CREA_VERBOSE_CMAKE)
147     MESSAGE(STATUS "Reading @LIBRARY_NAME@ additional configuration file")
148   ENDIF(CREA_VERBOSE_CMAKE)
149   # Include it
150   INCLUDE(${@LIBRARY_NAME@_DIR}/Additional@LIBRARY_NAME@Config.cmake)
151 ENDIF (@LIBRARY_NAME@_HAS_ADDITIONAL_CONFIG_FILE)