1 # ============================================================================ 2 # Copyright (c) 2015 <provider-name> 5 # See COPYING file for license information. 6 # ============================================================================ 8 ############################################################################## 9 # @file grlConfig.cmake 10 # @brief CMake package configuration file. 12 # @note The grlConfig.cmake file is automatically generated 13 # by BASIS from the template file Config.cmake.in which is part of 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., 23 # basis_set_config (INCLUDE_DIR "/Users/athundt/source/grl/build/include;/Users/athundt/source/grl/include") 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 (_). 31 # See the Config.cmake.in file of BASIS for details. 33 # @ingroup BasisConfig 34 ############################################################################## 36 ## @addtogroup BasisConfig 40 # ============================================================================ 42 # ============================================================================ 44 # prefix used for variable names 47 # allow caller to change
namespace - used by projects with modules
48 if (${NS}CONFIG_PREFIX)
49 set (NS
"${${NS}CONFIG_PREFIX}_")
52 # ---------------------------------------------------------------------------- 53 macro (basis_set_config NAME)
54 set (${NS}${NAME} ${ARGN})
57 # ---------------------------------------------------------------------------- 58 macro (basis_copy_config NAME SRC)
59 set (${NS}${NAME} ${${NS}${SRC}})
62 # ---------------------------------------------------------------------------- 63 macro (basis_append_config NAME)
64 list (APPEND ${NS}${NAME} ${ARGN})
67 # ---------------------------------------------------------------------------- 68 macro (basis_find_config NAME VALUE IDX)
69 list (FIND ${NS}${NAME}
"${VALUE}" ${IDX})
72 # ---------------------------------------------------------------------------- 73 macro (basis_remove_duplicates_config NAME)
75 list (REMOVE_DUPLICATES ${NS}${NAME})
79 # ---------------------------------------------------------------------------- 80 macro (basis_remove_item_config NAME ITEM)
82 list (REMOVE_ITEM ${NS}${NAME}
"${ITEM}")
86 # ---------------------------------------------------------------------------- 87 if (NOT COMMAND basis_is_cached)
88 macro (basis_is_cached VAR ENTRY)
90 get_property (${VAR} CACHE ${ENTRY} PROPERTY TYPE SET)
97 # ---------------------------------------------------------------------------- 98 if (NOT COMMAND basis_set_or_update_value)
99 macro (basis_set_or_update_value VAR)
100 basis_is_cached (_CACHED ${VAR})
102 if (${ARGC} GREATER 1)
103 set_property (CACHE ${VAR} PROPERTY VALUE ${ARGN})
105 set (${VAR}
"" CACHE INTERNAL
"" FORCE)
114 # ============================================================================ 116 # ============================================================================ 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)
122 ## @brief Project use file to be included by other projects.
123 basis_set_config (USE_FILE
"${CMAKE_CURRENT_LIST_DIR}/grlUse.cmake")
125 ## @brief Directory of example files. 126 basis_set_config (EXAMPLE_DIR
"")
128 # ============================================================================ 130 # ============================================================================ 132 ## @brief Directory of header files. 133 basis_set_config (INCLUDE_DIR
"/Users/athundt/source/grl/build/include;/Users/athundt/source/grl/include")
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
"")
140 ## @brief Directory of libraries. 141 basis_set_config (LIBRARY_DIR
"/Users/athundt/source/grl/build/lib")
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
"")
148 ## @brief Search path for Python modules. 149 basis_set_config (PYTHONPATH
"/Users/athundt/source/grl/build/lib/python")
151 ## @brief Search path for Jython modules. 152 basis_set_config (JYTHONPATH
"/Users/athundt/source/grl/build/lib/jython")
154 ## @brief Search path for Perl modules. 155 basis_set_config (PERL5LIB
"/Users/athundt/source/grl/build/lib/perl")
157 ## @brief Search path for MATLAB modules. 158 basis_set_config (MATLABPATH
"/Users/athundt/source/grl/build/lib/matlab")
160 ## @brief Search path for Bash modules. 162 # See the import() function of the BASIS Bash utilities. 163 basis_set_config (BASHPATH
"/Users/athundt/source/grl/build/lib/bash")
165 # ============================================================================ 167 # ============================================================================ 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")
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")
175 # ============================================================================ 177 # ============================================================================ 179 ## @brief Directory containing module configuration files 180 basis_set_config (MODULES_DIR
"/Users/athundt/source/grl/build/lib/cmake/grl")
182 ## @brief List of known project modules. 183 basis_set_config (MODULES
"")
185 ## @brief List of found requested modules. 186 basis_set_config (MODULES_FOUND)
188 ## @brief List of not found optional modules. 189 basis_set_config (MODULES_NOTFOUND)
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})
202 basis_remove_duplicates_config (MODULES)
203 basis_remove_duplicates_config (MODULES_ENABLED)
205 unset (_CONFIG_FILES)
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)
216 if (NOT ${NS}MODULES_REQUESTED)
217 basis_copy_config (MODULES_REQUESTED MODULES_ENABLED)
220 basis_remove_duplicates_config (MODULES_REQUESTED)
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})
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})
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})
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})
258 if (${NS}MODULES_NOTFOUND)
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})
269 list (APPEND _OPTIONAL ${_MODULE_NAME})
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")
290 # ============================================================================ 291 # clean INCLUDE_DIRS and LIBRARY_DIRS 292 # ============================================================================ 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)
299 basis_remove_item_config (INCLUDE_DIRS
"")
300 basis_remove_item_config (LIBRARY_DIRS
"")
302 # ============================================================================ 304 # ============================================================================ 306 set (_depwarn
" set to different value than during the configuration of grl." 307 " Using different versions of a dependency may cause inconsistencies!")
309 if (DEPENDS_FlatBuffers_DIR)
310 if (NOT DEPENDS_FlatBuffers_DIR STREQUAL
"/usr/local")
311 message (WARNING DEPENDS_FlatBuffers_DIR ${_depwarn})
314 basis_set_or_update_value (DEPENDS_FlatBuffers_DIR
"/usr/local")
317 if (DEPENDS_Boost_DIR)
318 if (NOT DEPENDS_Boost_DIR STREQUAL
"/usr/local")
319 message (WARNING DEPENDS_Boost_DIR ${_depwarn})
322 basis_set_or_update_value (DEPENDS_Boost_DIR
"/usr/local")
325 if (DEPENDS_Eigen3_DIR)
326 if (NOT DEPENDS_Eigen3_DIR STREQUAL
"/usr/local")
327 message (WARNING DEPENDS_Eigen3_DIR ${_depwarn})
330 basis_set_or_update_value (DEPENDS_Eigen3_DIR
"/usr/local")
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})
338 basis_set_or_update_value (DEPENDS_ur_modern_driver_DIR
"/usr/local")
341 if (DEPENDS_CisstNetlib_DIR)
342 if (NOT DEPENDS_CisstNetlib_DIR STREQUAL
"/usr/local/Cellar/cisstnetlib/HEAD")
343 message (WARNING DEPENDS_CisstNetlib_DIR ${_depwarn})
346 basis_set_or_update_value (DEPENDS_CisstNetlib_DIR
"/usr/local/Cellar/cisstnetlib/HEAD")
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})
354 basis_set_or_update_value (DEPENDS_cisst_DIR
"/usr/local/share/cisst-1.0")
357 if (DEPENDS_Ceres_DIR)
358 if (NOT DEPENDS_Ceres_DIR STREQUAL
"/usr/local")
359 message (WARNING DEPENDS_Ceres_DIR ${_depwarn})
362 basis_set_or_update_value (DEPENDS_Ceres_DIR
"/usr/local")
365 if (DEPENDS_CAMODOCAL_DIR)
366 if (NOT DEPENDS_CAMODOCAL_DIR STREQUAL
"/usr/local")
367 message (WARNING DEPENDS_CAMODOCAL_DIR ${_depwarn})
370 basis_set_or_update_value (DEPENDS_CAMODOCAL_DIR
"/usr/local")
373 if (DEPENDS_freenect2_DIR)
374 if (NOT DEPENDS_freenect2_DIR STREQUAL
"/usr/local")
375 message (WARNING DEPENDS_freenect2_DIR ${_depwarn})
378 basis_set_or_update_value (DEPENDS_freenect2_DIR
"/usr/local")
382 if (NOT DEPENDS_ROS_DIR STREQUAL
"/opt/ros/indigo")
383 message (WARNING DEPENDS_ROS_DIR ${_depwarn})
386 basis_set_or_update_value (DEPENDS_ROS_DIR
"/opt/ros/indigo")
390 # ============================================================================ 392 # ============================================================================ 394 # Add further package configuration settings here. 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 $