grlConfig.cmake
Go to the documentation of this file.
1 # ============================================================================
2 # Copyright (c) 2015 <provider-name>
3 # All rights reserved.
4 #
5 # See COPYING file for license information.
6 # ============================================================================
7 
8 ##############################################################################
9 # @file grlConfig.cmake
10 # @brief CMake package configuration file.
11 #
12 # @note The grlConfig.cmake file is automatically generated
13 # by BASIS from the template file Config.cmake.in which is part of
14 # the grl package.
15 #
16 # Variables in this file have to be prefixed by the name of this package.
17 # In the default package configuration file of BASIS, which can be included
18 # here using the \@BASIS_CONFIG\@ variable, this prefix is defined as @c NS
19 # variable. Moreover, the macro basis_set_config() should be used for
20 # convenience to set any configuration variable, e.g.,
21 #
22 # @code
23 # basis_set_config (INCLUDE_DIR "/Users/athundt/source/grl/build/include;/Users/athundt/source/grl/include")
24 # @endcode
25 #
26 # where the variable @c INCLUDE_DIR_CONFIG is set in the ConfigSettings.cmake
27 # file of the BASIS installation. Note that this statement will set the
28 # variable ${NS}INCLUDE_DIR, where by default @c NS is the package name
29 # followed by an underscore (_).
30 #
31 # See the Config.cmake.in file of BASIS for details.
32 #
33 # @ingroup BasisConfig
34 ##############################################################################
35 
36 ## @addtogroup BasisConfig
37 # @{
38 
39 
40 # ============================================================================
41 # namespace
42 # ============================================================================
43 
44 # prefix used for variable names
45 set (NS "grl_")
46 
47 # allow caller to change namespace - used by projects with modules
48 if (${NS}CONFIG_PREFIX)
49  set (NS "${${NS}CONFIG_PREFIX}_")
50 endif ()
51 
52 # ----------------------------------------------------------------------------
53 macro (basis_set_config NAME)
54  set (${NS}${NAME} ${ARGN})
55 endmacro ()
56 
57 # ----------------------------------------------------------------------------
58 macro (basis_copy_config NAME SRC)
59  set (${NS}${NAME} ${${NS}${SRC}})
60 endmacro ()
61 
62 # ----------------------------------------------------------------------------
63 macro (basis_append_config NAME)
64  list (APPEND ${NS}${NAME} ${ARGN})
65 endmacro ()
66 
67 # ----------------------------------------------------------------------------
68 macro (basis_find_config NAME VALUE IDX)
69  list (FIND ${NS}${NAME} "${VALUE}" ${IDX})
70 endmacro ()
71 
72 # ----------------------------------------------------------------------------
73 macro (basis_remove_duplicates_config NAME)
74  if (${NS}${NAME})
75  list (REMOVE_DUPLICATES ${NS}${NAME})
76  endif ()
77 endmacro ()
78 
79 # ----------------------------------------------------------------------------
80 macro (basis_remove_item_config NAME ITEM)
81  if (${NS}${NAME})
82  list (REMOVE_ITEM ${NS}${NAME} "${ITEM}")
83  endif ()
84 endmacro ()
85 
86 # ----------------------------------------------------------------------------
87 if (NOT COMMAND basis_is_cached)
88  macro (basis_is_cached VAR ENTRY)
89  if (DEFINED ${ENTRY})
90  get_property (${VAR} CACHE ${ENTRY} PROPERTY TYPE SET)
91  else ()
92  set (${VAR} FALSE)
93  endif ()
94  endmacro ()
95 endif ()
96 
97 # ----------------------------------------------------------------------------
98 if (NOT COMMAND basis_set_or_update_value)
99  macro (basis_set_or_update_value VAR)
100  basis_is_cached (_CACHED ${VAR})
101  if (_CACHED)
102  if (${ARGC} GREATER 1)
103  set_property (CACHE ${VAR} PROPERTY VALUE ${ARGN})
104  else ()
105  set (${VAR} "" CACHE INTERNAL "" FORCE)
106  endif ()
107  else ()
108  set (${VAR} ${ARGN})
109  endif ()
110  unset (_CACHED)
111  endmacro ()
112 endif ()
113 
114 # ============================================================================
115 # general
116 # ============================================================================
117 
118 ## @brief Installation prefix or root of build tree.
119 basis_set_config (INSTALL_PREFIX "/Users/athundt/source/grl/build")
120 get_filename_component (${NS}INSTALL_PREFIX "${${NS}INSTALL_PREFIX}" ABSOLUTE)
121 
122 ## @brief Project use file to be included by other projects.
123 basis_set_config (USE_FILE "${CMAKE_CURRENT_LIST_DIR}/grlUse.cmake")
124 
125 ## @brief Directory of example files.
126 basis_set_config (EXAMPLE_DIR "")
127 
128 # ============================================================================
129 # libraries
130 # ============================================================================
131 
132 ## @brief Directory of header files.
133 basis_set_config (INCLUDE_DIR "/Users/athundt/source/grl/build/include;/Users/athundt/source/grl/include")
134 
135 ## @brief Directory of header files including dependencies.
136 basis_set_config (INCLUDE_DIRS) # to have a set recognized by Doxygen filter
137 basis_copy_config (INCLUDE_DIRS INCLUDE_DIR)
138 basis_append_config (INCLUDE_DIRS "")
139 
140 ## @brief Directory of libraries.
141 basis_set_config (LIBRARY_DIR "/Users/athundt/source/grl/build/lib")
142 
143 ## @brief Directory of libraries including dependencies.
144 basis_set_config (LIBRARY_DIRS) # to have a set() recognized by Doxygen filter
145 basis_copy_config (LIBRARY_DIRS LIBRARY_DIR)
146 basis_append_config (LIBRARY_DIRS "")
147 
148 ## @brief Search path for Python modules.
149 basis_set_config (PYTHONPATH "/Users/athundt/source/grl/build/lib/python")
150 
151 ## @brief Search path for Jython modules.
152 basis_set_config (JYTHONPATH "/Users/athundt/source/grl/build/lib/jython")
153 
154 ## @brief Search path for Perl modules.
155 basis_set_config (PERL5LIB "/Users/athundt/source/grl/build/lib/perl")
156 
157 ## @brief Search path for MATLAB modules.
158 basis_set_config (MATLABPATH "/Users/athundt/source/grl/build/lib/matlab")
159 
160 ## @brief Search path for Bash modules.
161 #
162 # See the import() function of the BASIS Bash utilities.
163 basis_set_config (BASHPATH "/Users/athundt/source/grl/build/lib/bash")
164 
165 # ============================================================================
166 # exports
167 # ============================================================================
168 
169 ## @brief Absolute path of exports file to be included by other projects.
170 basis_set_config (EXPORTS_FILE "${CMAKE_CURRENT_LIST_DIR}/grlExports.cmake")
171 
172 ## @brief Absolute path of custom exports file to be included by other projects.
173 basis_set_config (CUSTOM_EXPORTS_FILE "${CMAKE_CURRENT_LIST_DIR}/grlCustomExports.cmake")
174 
175 # ============================================================================
176 # modules
177 # ============================================================================
178 
179 ## @brief Directory containing module configuration files
180 basis_set_config (MODULES_DIR "/Users/athundt/source/grl/build/lib/cmake/grl")
181 
182 ## @brief List of known project modules.
183 basis_set_config (MODULES "")
184 
185 ## @brief List of found requested modules.
186 basis_set_config (MODULES_FOUND)
187 
188 ## @brief List of not found optional modules.
189 basis_set_config (MODULES_NOTFOUND)
190 
191 ## @brief List of available project modules.
192 basis_set_config (MODULES_ENABLED)
193 file (GLOB _CONFIG_FILES "${${NS}MODULES_DIR}/grl*Config.cmake")
194 foreach (_CONFIG_FILE IN LISTS _CONFIG_FILES)
195  if (_CONFIG_FILE MATCHES "/grl([^ /][^ /]*)Config.cmake")
196  set (_MODULE_NAME ${CMAKE_MATCH_1})
197  basis_append_config (MODULES ${_MODULE_NAME})
198  basis_append_config (MODULES_ENABLED ${_MODULE_NAME})
199  endif ()
200 endforeach ()
201 
202 basis_remove_duplicates_config (MODULES)
203 basis_remove_duplicates_config (MODULES_ENABLED)
204 
205 unset (_CONFIG_FILES)
206 unset (_CONFIG_FILE)
207 
208 ## @brief List of modules requested by external package using the
209 # @c COMPONENTS argument of
210 # <a href="http://www.cmake.org/cmake/help/cmake-2-8-docs.html#command:find_package">
211 # find_package()</a>.
212 if (NOT DEFINED ${NS}MODULES_REQUESTED)
213  if (${NS}FIND_COMPONENTS)
214  basis_copy_config (MODULES_REQUESTED FIND_COMPONENTS)
215  endif ()
216  if (NOT ${NS}MODULES_REQUESTED)
217  basis_copy_config (MODULES_REQUESTED MODULES_ENABLED)
218  endif ()
219 endif ()
220 basis_remove_duplicates_config (MODULES_REQUESTED)
221 
222 set (_PACKAGE_NS "${NS}")
223 foreach (_MODULE_NAME IN LISTS ${NS}MODULES_REQUESTED)
224  # check if requested module is available
225  basis_find_config (MODULES_ENABLED ${_MODULE_NAME} _MODULE_IDX)
226  if (_MODULE_IDX EQUAL -1)
227  # set <Pkg>_<Module>_FOUND = FALSE
228  basis_set_config (${_MODULE_NAME}_FOUND FALSE)
229  # append to list of not found requested modules
230  basis_append_config (MODULES_NOTFOUND ${_MODULE_NAME})
231  else ()
232  set (_MODULE_NS "${NS}${_MODULE_NAME}_")
233  # include configuration file of module
234  set (${_MODULE_NAME}_CONFIG_PREFIX "${_MODULE_NS}")
235  include ("${${NS}MODULES_DIR}/grl${_MODULE_NAME}Config.cmake")
236  unset (${_MODULE_NAME}_CONFIG_PREFIX)
237  set (NS "${_PACKAGE_NS}") # restore NS of this package config
238  # append include directories
239  if (${_MODULE_NS}INCLUDE_DIRS)
240  basis_append_config (INCLUDE_DIRS ${${_MODULE_NS}INCLUDE_DIRS})
241  elseif (${_MODULE_NS}INCLUDE_DIR)
242  basis_append_config (INCLUDE_DIRS ${${_MODULE_NS}INCLUDE_DIR})
243  endif ()
244  # append library directories
245  if (${_MODULE_NS}LIBRARY_DIRS)
246  basis_append_config (LIBRARY_DIRS ${${_MODULE_NS}LIBRARY_DIRS})
247  elseif (${_MODULE_NS}LIBARY_DIR)
248  basis_append_config (LIBRARY_DIRS ${${_MODULE_NS}LIBRARY_DIR})
249  endif ()
250  # set <Pkg>_<Module>_FOUND = TRUE
251  basis_set_config (${_MODULE_NAME}_FOUND TRUE)
252  # append to list of found requested modules
253  basis_append_config (MODULES_FOUND ${_MODULE_NAME})
254  endif ()
255 endforeach ()
256 unset (_PACKAGE_NS)
257 
258 if (${NS}MODULES_NOTFOUND)
259  set (_REQUIRED)
260  set (_OPTIONAL)
261  set (_MISSING)
262  foreach (_MODULE_NAME IN LISTS ${NS}MODULES_REQUESTED)
263  if (${NS}FIND_REQUIRED_${_MODULE_NAME})
264  list (APPEND _REQUIRED ${_MODULE_NAME})
265  if (NOT ${NS}${_MODULE_NAME}_FOUND)
266  list (APPEND _MISSING ${_MODULE_NAME})
267  endif ()
268  else ()
269  list (APPEND _OPTIONAL ${_MODULE_NAME})
270  endif ()
271  endforeach ()
272  if (_MISSING)
273  message(FATAL_ERROR "Could not find all required grl components!"
274  " Rebuild and/or install the grl package with"
275  " the following modules enabled by setting MODULE_<name>"
276  " to ON when configuring the build of the package with CMake."
277  "\nOptional modules = [${_OPTIONAL}]"
278  "\nRequired modules = [${_REQUIRED}]"
279  "\nMissing modules = [${_MISSING}]\n")
280  endif ()
281  unset (_REQUIRED)
282  unset (_OPTIONAL)
283  unset (_MISSING)
284 endif ()
285 
286 unset (_MODULE_NAME)
287 unset (_MODULE_IDX)
288 unset (_MODULE_NS)
289 
290 # ============================================================================
291 # clean INCLUDE_DIRS and LIBRARY_DIRS
292 # ============================================================================
293 
294 basis_remove_duplicates_config (INCLUDE_DIR)
295 basis_remove_duplicates_config (INCLUDE_DIRS)
296 basis_remove_duplicates_config (LIBRARY_DIR)
297 basis_remove_duplicates_config (LIBRARY_DIRS)
298 
299 basis_remove_item_config (INCLUDE_DIRS "")
300 basis_remove_item_config (LIBRARY_DIRS "")
301 
302 # ============================================================================
303 # dependencies
304 # ============================================================================
305 
306 set (_depwarn " set to different value than during the configuration of grl."
307  " Using different versions of a dependency may cause inconsistencies!")
308 # FlatBuffers
309 if (DEPENDS_FlatBuffers_DIR)
310  if (NOT DEPENDS_FlatBuffers_DIR STREQUAL "/usr/local")
311  message (WARNING DEPENDS_FlatBuffers_DIR ${_depwarn})
312  endif ()
313 else ()
314  basis_set_or_update_value (DEPENDS_FlatBuffers_DIR "/usr/local")
315 endif ()
316 # Boost
317 if (DEPENDS_Boost_DIR)
318  if (NOT DEPENDS_Boost_DIR STREQUAL "/usr/local")
319  message (WARNING DEPENDS_Boost_DIR ${_depwarn})
320  endif ()
321 else ()
322  basis_set_or_update_value (DEPENDS_Boost_DIR "/usr/local")
323 endif ()
324 # Eigen3
325 if (DEPENDS_Eigen3_DIR)
326  if (NOT DEPENDS_Eigen3_DIR STREQUAL "/usr/local")
327  message (WARNING DEPENDS_Eigen3_DIR ${_depwarn})
328  endif ()
329 else ()
330  basis_set_or_update_value (DEPENDS_Eigen3_DIR "/usr/local")
331 endif ()
332 # ur_modern_driver
333 if (DEPENDS_ur_modern_driver_DIR)
334  if (NOT DEPENDS_ur_modern_driver_DIR STREQUAL "/usr/local")
335  message (WARNING DEPENDS_ur_modern_driver_DIR ${_depwarn})
336  endif ()
337 else ()
338  basis_set_or_update_value (DEPENDS_ur_modern_driver_DIR "/usr/local")
339 endif ()
340 # CisstNetlib
341 if (DEPENDS_CisstNetlib_DIR)
342  if (NOT DEPENDS_CisstNetlib_DIR STREQUAL "/usr/local/Cellar/cisstnetlib/HEAD")
343  message (WARNING DEPENDS_CisstNetlib_DIR ${_depwarn})
344  endif ()
345 else ()
346  basis_set_or_update_value (DEPENDS_CisstNetlib_DIR "/usr/local/Cellar/cisstnetlib/HEAD")
347 endif ()
348 # cisst
349 if (DEPENDS_cisst_DIR)
350  if (NOT DEPENDS_cisst_DIR STREQUAL "/usr/local/share/cisst-1.0")
351  message (WARNING DEPENDS_cisst_DIR ${_depwarn})
352  endif ()
353 else ()
354  basis_set_or_update_value (DEPENDS_cisst_DIR "/usr/local/share/cisst-1.0")
355 endif ()
356 # Ceres
357 if (DEPENDS_Ceres_DIR)
358  if (NOT DEPENDS_Ceres_DIR STREQUAL "/usr/local")
359  message (WARNING DEPENDS_Ceres_DIR ${_depwarn})
360  endif ()
361 else ()
362  basis_set_or_update_value (DEPENDS_Ceres_DIR "/usr/local")
363 endif ()
364 # CAMODOCAL
365 if (DEPENDS_CAMODOCAL_DIR)
366  if (NOT DEPENDS_CAMODOCAL_DIR STREQUAL "/usr/local")
367  message (WARNING DEPENDS_CAMODOCAL_DIR ${_depwarn})
368  endif ()
369 else ()
370  basis_set_or_update_value (DEPENDS_CAMODOCAL_DIR "/usr/local")
371 endif ()
372 # freenect2
373 if (DEPENDS_freenect2_DIR)
374  if (NOT DEPENDS_freenect2_DIR STREQUAL "/usr/local")
375  message (WARNING DEPENDS_freenect2_DIR ${_depwarn})
376  endif ()
377 else ()
378  basis_set_or_update_value (DEPENDS_freenect2_DIR "/usr/local")
379 endif ()
380 # ROS
381 if (DEPENDS_ROS_DIR)
382  if (NOT DEPENDS_ROS_DIR STREQUAL "/opt/ros/indigo")
383  message (WARNING DEPENDS_ROS_DIR ${_depwarn})
384  endif ()
385 else ()
386  basis_set_or_update_value (DEPENDS_ROS_DIR "/opt/ros/indigo")
387 endif ()
388 unset (_depwarn)
389 
390 # ============================================================================
391 # grl configuration
392 # ============================================================================
393 
394 # Add further package configuration settings here.
395 
396 
397 ## @}
398 # end of Doxygen group - keep at end of file
or our tests failed to detect it correctly Please use a different C compiler or report this problem to the developers endif() if(UNIX AND CMAKE_SYSTEM_PROCESSOR MATCHES "x86_64") endif(UNIX AND CMAKE_SYSTEM_PROCESSOR MATCHES "x86_64") if(APPLE) set(CMAKE_MACOSX_RPATH ON)() endif() if(OpenCV_FOUND) if(NOT $
Definition: Settings.cmake:39