FindBoostNumericBindings.cmake
Go to the documentation of this file.
1 ##############################################################################
2 # @file FindBoostNumericBindings.cmake
3 # @brief Find Boost Numeric Bindings package.
4 #
5 # This module looks for an installation of the Boost Numeric Bindings package,
6 # a bindings library for Boost.Ublas
7 # (see http://mathema.tician.de/software/boost-numeric-bindings). Note that
8 # you will also need Boost.Ublas in order to use this headers-only library.
9 #
10 # @par Input variables:
11 # <table border="0">
12 # <tr>
13 # @tp @b BoostNumericBindings_DIR @endtp
14 # <td>The Boost Numeric Bindings package files are searched under the
15 # specified root directory. This variable can also be set as environment
16 # variable.</td>
17 # </tr>
18 # <tr>
19 # @tp @b BOOSTNUMERICBINDINGS_DIR @endtp
20 # <td>Alternative environment variable for @p BoostNumericBindings_DIR.</td>
21 # </tr>
22 # </table>
23 #
24 # @par Output variables:
25 # <table border="0">
26 # <tr>
27 # @tp @b BoostNumericBindings_FOUND @endtp
28 # <td>Whether the Boost Numeric Bindings package was found and the following
29 # CMake variables are valid.</td>
30 # </tr>
31 # <tr>
32 # @tp @b BoostNumericBindings_INCLUDE_DIR @endtp
33 # <td>Cached include directory/ies.</td>
34 # </tr>
35 # <tr>
36 # @tp @b BoostNumericBindings_INCLUDE_DIRS @endtp
37 # <td>Alias for @p BoostNumericBindings_INCLUDE_DIR (not cached).</td>
38 # </tr>
39 # <tr>
40 # @tp @b BoostNumericBindings_INCLUDES @endtp
41 # <td>Alias for @p BoostNumericBindings_INCLUDE_DIR (not cached).</td>
42 # </tr>
43 # </table>
44 #
45 # @ingroup CMakeFindModules
46 ##############################################################################
47 
48 #=============================================================================
49 # Copyright 2011-2012 University of Pennsylvania
50 # Copyright 2013-2016 Andreas Schuh <andreas.schuh.84@gmail.com>
51 #
52 # Distributed under the OSI-approved BSD License (the "License");
53 # see accompanying file Copyright.txt for details.
54 #
55 # This software is distributed WITHOUT ANY WARRANTY; without even the
56 # implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
57 # See the License for more information.
58 #=============================================================================
59 # (To distribute this file outside of CMake, substitute the full
60 # License text for the above reference.)
61 
62 # ----------------------------------------------------------------------------
63 # initialize search
65  if (NOT "$ENV{BOOSTNUMERICBINDINGS_DIR}" STREQUAL "")
66  set (
67  BoostNumericBindings_DIR
68  "$ENV{BOOSTNUMERICBINDINGS_DIR}"
69  CACHE PATH
70  "Installation prefix of boost-numeric-bindings."
71  FORCE
72  )
73  else ()
74  set (
75  BoostNumericBindings_DIR
76  "$ENV{BoostNumericBindings_DIR}"
77  CACHE PATH
78  "Installation prefix of boost-numeric-bindings."
79  FORCE
80  )
81  endif ()
82 endif ()
83 
84 # ----------------------------------------------------------------------------
85 # find paths/files
86 if (BoostNumericBindings_DIR)
87 
88  find_path (
89  BoostNumericBindings_INCLUDE_DIR
90  NAMES boost/numeric/bindings/atlas/cblas.hpp
91  HINTS ${BoostNumericBindings_DIR}
92  PATH_SUFFIXES "include" "include/boost-numeric-bindings"
93  DOC "Root include directory of boost-numeric-bindings."
94  NO_DEFAULT_PATH
95  )
96 
97 else ()
98 
99  find_path (
100  BoostNumericBindings_INCLUDE_DIR
101  NAMES boost/numeric/bindings/atlas/cblas.hpp
102  HINTS ENV C_INCLUDE_PATH ENV CXX_INCLUDE_PATH
103  PATH_SUFFIXES boost-numeric-bindings
104  DOC "Root include directory of boost-numeric-bindings."
105  )
106 
107 endif ()
108 
109 mark_as_advanced (BoostNumericBindings_INCLUDE_DIR)
110 
111 # ----------------------------------------------------------------------------
112 # aliases / backwards compatibility
113 if (BoostNumericBindings_INCLUDE_DIR)
114  set (BoostNumericBindings_INCLUDE_DIRS "${BoostNumericBindings_INCLUDE_DIR}")
115  set (BoostNumericBindings_INCLUDES "${BoostNumericBindings_INCLUDE_DIR}")
116 endif ()
117 
118 # ----------------------------------------------------------------------------
119 # handle the QUIETLY and REQUIRED arguments and set *_FOUND to TRUE
120 # if all listed variables are found or TRUE
121 include (FindPackageHandleStandardArgs)
122 
123 find_package_handle_standard_args (
124  BoostNumericBindings
125  REQUIRED_VARS
126  BoostNumericBindings_INCLUDE_DIR
127 )
128 
129 set (BoostNumericBindings_FOUND ${BOOSTNUMERICBINDINGS_FOUND})
130 
131 # ----------------------------------------------------------------------------
132 # set BoostNumericBindings_DIR
133 if (NOT BoostNumericBindings_DIR AND BoostNumericBindings_FOUND)
134  set (
135  BoostNumericBindings_DIR
136  "${BoostNumericBindings_INCLUDE_DIR}"
137  CACHE PATH
138  "Installation prefix for NiftiCLib."
139  FORCE
140  )
141 endif ()
cmake BoostNumericBindings_FOUND
cmake BoostNumericBindings_INCLUDES
path BoostNumericBindings_DIR