]> Creatis software - crea.git/blob - cmake/InstallLibraryForCMake_LibraryConfig.cmake.in
cc692fd23b1d687192b5fc1b86cf42f8cfe65281
[crea.git] / cmake / InstallLibraryForCMake_LibraryConfig.cmake.in
1 #-----------------------------------------------------------------------------
2 #
3 # @LIBRARY_NAME@Config.cmake - CMake configuration file for external projects.
4 # This file was automatically generated by the cmake macro 
5 # CREA_INSTALL_LIBRARY_FOR_CMAKE of the package CREA
6 #
7 # This file is configured by cmake and used by the
8 # Use@LIBRARY_NAME@.cmake module to load the lib settings 
9 # for an external project.
10
11 # Build tree config ?
12 SET(CILC_BUILD_TREE_CONFIGURATION @CILC_BUILD_TREE_CONFIGURATION@)
13
14
15 IF(UNIX)
16 SET(GOTO_INSTALL_PREFIX /../../..)
17 ENDIF(UNIX)
18
19
20 # The @LIBRARY_NAME@ include file *RELATIVE* directories.
21 SET(CILC_RELATIVE_INCLUDE_PATHS "@CILC_LIB_RELATIVE_INCLUDE_PATHS@")
22 # Compute the prefix for include and library paths
23 IF(CILC_BUILD_TREE_CONFIGURATION)
24   # In build tree 
25   # the include paths are relative to the source tree *AND* the binary tree 
26   # for generated files 
27   SET(CILC_INCLUDE_PATH_PREFIX @PROJECT_SOURCE_DIR@)
28   # Build the *ABSOLUTE* directories
29   FOREACH(path ${CILC_RELATIVE_INCLUDE_PATHS})
30     SET(@LIBRARY_NAME@_INCLUDE_DIRS
31       ${@LIBRARY_NAME@_INCLUDE_DIRS}
32       ${CILC_INCLUDE_PATH_PREFIX}/${path}
33       )
34   ENDFOREACH(path ${CILC_RELATIVE_INCLUDE_PATHS})
35   SET(CILC_INCLUDE_PATH_PREFIX @PROJECT_BINARY_DIR@)
36   # Build the *ABSOLUTE* directories
37   FOREACH(path ${CILC_RELATIVE_INCLUDE_PATHS})
38     SET(@LIBRARY_NAME@_INCLUDE_DIRS
39       ${@LIBRARY_NAME@_INCLUDE_DIRS}
40       ${CILC_INCLUDE_PATH_PREFIX}/${path}
41       )
42   ENDFOREACH(path ${CILC_RELATIVE_INCLUDE_PATHS})
43 ELSE(CILC_BUILD_TREE_CONFIGURATION)
44   # In install tree 
45   # the include paths are relative to install prefix 
46   # On unix , GOTO_INSTALL_PREFIX allows to get back to the 
47   # installation prefix from  @LIBRARY_NAME@_DIR
48   SET(CILC_INCLUDE_PATH_PREFIX ${@LIBRARY_NAME@_DIR}${GOTO_INSTALL_PREFIX})
49   # Build the *ABSOLUTE* directories
50   FOREACH(path ${CILC_RELATIVE_INCLUDE_PATHS})
51     SET(@LIBRARY_NAME@_INCLUDE_DIRS
52       ${@LIBRARY_NAME@_INCLUDE_DIRS}
53       ${CILC_INCLUDE_PATH_PREFIX}/${path}
54       )
55   ENDFOREACH(path ${CILC_RELATIVE_INCLUDE_PATHS})
56 ENDIF(CILC_BUILD_TREE_CONFIGURATION)
57
58
59
60 # Compute the prefix for library paths
61 IF(CILC_BUILD_TREE_CONFIGURATION)
62   # In build tree
63   # the library paths are relative to the binary tree 
64   SET(CILC_LIBRARY_PATH_PREFIX @PROJECT_BINARY_DIR@)
65 ELSE(CILC_BUILD_TREE_CONFIGURATION)
66   # In install tree 
67   # the library paths are relative to install prefix
68   SET(CILC_LIBRARY_PATH_PREFIX ${@LIBRARY_NAME@_DIR}${GOTO_INSTALL_PREFIX})
69 ENDIF(CILC_BUILD_TREE_CONFIGURATION)
70 # The @LIBRARY_NAME@ library file *RELATIVE* directories.
71 SET(CILC_RELATIVE_LIBRARY_PATHS "@CILC_LIB_RELATIVE_LIBRARY_PATHS@")
72 # Build the *ABSOLUTE* directories
73 FOREACH(path ${CILC_RELATIVE_LIBRARY_PATHS})
74   SET(@LIBRARY_NAME@_LIBRARY_DIRS
75     ${@LIBRARY_NAME@_LIBRARY_DIRS}
76     ${CILC_LIBRARY_PATH_PREFIX}/${path}
77     )
78 ENDFOREACH(path ${CILC_RELATIVE_LIBRARY_PATHS})
79
80 # Set the "prefix path"
81 SET(@LIBRARY_NAME@_INSTALL_PREFIX ${CILC_LIBRARY_PATH_PREFIX})
82
83 # The C and C++ flags added by @LIBRARY_NAME@ to the cmake-configured flags.
84 SET(@LIBRARY_NAME@_REQUIRED_C_FLAGS "@CILC_LIB_REQUIRED_C_FLAGS@")
85 SET(@LIBRARY_NAME@_REQUIRED_CXX_FLAGS "@CILC_LIB_REQUIRED_CXX_FLAGS@")
86 SET(@LIBRARY_NAME@_REQUIRED_LINK_FLAGS "@CILC_LIB_REQUIRED_LINK_FLAGS@")
87
88 # The @LIBRARY_NAME@ version 
89 SET(@LIBRARY_NAME@_MAJOR_VERSION @CILC_LIB_MAJOR_VERSION@)
90 SET(@LIBRARY_NAME@_MINOR_VERSION @CILC_LIB_MINOR_VERSION@)
91 SET(@LIBRARY_NAME@_BUILD_VERSION @CILC_LIB_BUILD_VERSION@)
92 SET(@LIBRARY_NAME@_VERSION @CILC_LIB_VERSION@)
93
94 # The location of the Use@LIBRARY_NAME@.cmake file.
95 SET(@LIBRARY_NAME@_USE_FILE "${@LIBRARY_NAME@_DIR}/Use@LIBRARY_NAME@.cmake")
96
97 # The build settings file.
98 SET(@LIBRARY_NAME@_BUILD_SETTINGS_FILE 
99   "${@LIBRARY_NAME@_DIR}/@LIBRARY_NAME@BuildSettings.cmake")
100
101 # A list of all libraries for @LIBRARY_NAME@.  Those listed here should
102 # automatically pull in their dependencies.
103 SET(@LIBRARY_NAME@_LIBRARIES @CILC_LIB_LIBRARIES@)
104
105 # Messages
106 IF(CREA_VERBOSE_CMAKE)
107   MESSAGE(STATUS "=======================================")
108   MESSAGE(STATUS "Looking for @LIBRARY_NAME@... found:")
109   MESSAGE(STATUS "* @LIBRARY_NAME@_DIR          = ${@LIBRARY_NAME@_DIR}")
110   MESSAGE(STATUS "* @LIBRARY_NAME@_VERSION      = ${@LIBRARY_NAME@_VERSION}")
111   MESSAGE(STATUS "* @LIBRARY_NAME@_USE_FILE     = ${@LIBRARY_NAME@_USE_FILE}")
112
113   MESSAGE(STATUS "* @LIBRARY_NAME@_INCLUDE_DIRS = ${@LIBRARY_NAME@_INCLUDE_DIRS}")
114   MESSAGE(STATUS "* @LIBRARY_NAME@_LIBRARY_DIRS = ${@LIBRARY_NAME@_LIBRARY_DIRS}")
115   MESSAGE(STATUS "* @LIBRARY_NAME@_LIBRARIES    = ${@LIBRARY_NAME@_LIBRARIES}")
116 ENDIF(CREA_VERBOSE_CMAKE)
117
118 # Does the library has an additional config file (user provided) ?
119 SET(@LIBRARY_NAME@_HAS_ADDITIONAL_CONFIG_FILE @CILC_LIB_HAS_ADDITIONAL_CONFIG_FILE@)
120
121 IF (@LIBRARY_NAME@_HAS_ADDITIONAL_CONFIG_FILE)
122   IF(CREA_VERBOSE_CMAKE)
123     MESSAGE(STATUS "Reading @LIBRARY_NAME@ additional configuration file")
124   ENDIF(CREA_VERBOSE_CMAKE)
125   # Include it
126   INCLUDE(${@LIBRARY_NAME@_DIR}/Additional@LIBRARY_NAME@Config.cmake)
127 ENDIF (@LIBRARY_NAME@_HAS_ADDITIONAL_CONFIG_FILE)