grlUse.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 grlUse.cmake
10 # @brief CMake package configuration use file.
11 #
12 # @note The grlUse.cmake file is automatically generated
13 # by BASIS from the template file ConfigUse.cmake.in which is part of
14 # the grl package.
15 #
16 # In the default package use file of BASIS, which can be included here using
17 # the \@BASIS_USE\@ variable, the prefix used by the package configuration
18 # file is defined as @c NS variable. Thus, to use any variable set by the
19 # corresponding package configuration file, use code similar to:
20 #
21 # @code
22 # include_directories (${${NS}INCLUDE_DIRS})
23 # @endcode
24 #
25 # See the ConfigUse.cmake.in file of BASIS for details.
26 #
27 # @note The CMake code which is substituted for the \@BASIS_USE\@ variable
28 # contains an include guard.
29 #
30 # @ingroup BasisConfig
31 ##############################################################################
32 
33 # ============================================================================
34 # namespace
35 # ============================================================================
36 
37 # prefix used for variable names
38 set (NS "grl_")
39 
40 # allow caller to change namespace - used by projects with modules
41 if (${NS}CONFIG_PREFIX)
42  set (NS "${${NS}CONFIG_PREFIX}_")
43 endif ()
44 
45 # ============================================================================
46 # include guard
47 # ============================================================================
48 
49 if (__${NS}USE_FILE_INCLUDED)
50  return ()
51 else ()
52  set (__${NS}USE_FILE_INCLUDED 1)
54 
55 # ============================================================================
56 # use project settings
57 # ============================================================================
58 
59 # include directories
60 if (${NS}INCLUDE_DIRS)
61  include_directories (${${NS}INCLUDE_DIRS})
62 elseif (${NS}INCLUDE_DIR)
63  include_directories (${${NS}INCLUDE_DIR})
64 endif ()
65 
66 # library directories
67 if (${NS}LIBRARY_DIRS)
68  link_directories (${${NS}LIBRARY_DIRS})
69 elseif (${NS}LIBRARY_DIR)
70  link_directories (${${NS}LIBRARY_DIR})
71 endif ()
72 
73 # ============================================================================
74 # import build targets
75 # ============================================================================
76 
77 ## @brief Whether to import the exported targets.
78 set (NO_${NS}IMPORTS "${NO_${NS}IMPORTS}")
79 
80 if (NOT NO_${NS}IMPORTS)
81  include ("${${NS}EXPORTS_FILE}" OPTIONAL)
82  include ("${${NS}CUSTOM_EXPORTS_FILE}" OPTIONAL)
83 endif ()
84 
85 # ============================================================================
86 # use modules
87 # ============================================================================
88 
89 foreach (M IN LISTS ${NS}MODULES_REQUESTED)
90  if (${NS}${M}_USE_FILE)
91  set (${M}_CONFIG_PREFIX "${NS}${M}_")
92  include ("${${NS}${M}_USE_FILE}")
93  unset (${M}_CONFIG_PREFIX)
94  endif ()
95 endforeach ()
96 
97 # ============================================================================
98 # grl configuration
99 # ============================================================================
100 
101 # Use further project package configuration settings here.
INCLUDE_DIRS include_directories(${${NS}INCLUDE_DIRS}) elseif($
Definition: grlUse.cmake:61
USE_FILE_INCLUDED endif() if($
Definition: grlUse.cmake:53
LIBRARY_DIRS link_directories(${${NS}LIBRARY_DIRS}) elseif($
Definition: grlUse.cmake:68