version.cc
Go to the documentation of this file.
1 //
2 // Copyright (c) 2019 CNRS INRIA
3 //
4 
5 #include "hpp/fcl/config.hh"
6 #include "fcl.hh"
7 #include <boost/preprocessor/stringize.hpp>
8 
9 namespace bp = boost::python;
10 
11 inline bool checkVersionAtLeast(int major, int minor, int patch) {
12  return HPP_FCL_VERSION_AT_LEAST(major, minor, patch);
13 }
14 
15 inline bool checkVersionAtMost(int major, int minor, int patch) {
16  return HPP_FCL_VERSION_AT_MOST(major, minor, patch);
17 }
18 
19 void exposeVersion() {
20  // Define release numbers of the current hpp-fcl version.
21  bp::scope().attr("__version__") =
22  BOOST_PP_STRINGIZE(HPP_FCL_MAJOR_VERSION) "." BOOST_PP_STRINGIZE(HPP_FCL_MINOR_VERSION) "." BOOST_PP_STRINGIZE(HPP_FCL_PATCH_VERSION);
23  bp::scope().attr("__raw_version__") = HPP_FCL_VERSION;
24  bp::scope().attr("HPP_FCL_MAJOR_VERSION") = HPP_FCL_MAJOR_VERSION;
25  bp::scope().attr("HPP_FCL_MINOR_VERSION") = HPP_FCL_MINOR_VERSION;
26  bp::scope().attr("HPP_FCL_PATCH_VERSION") = HPP_FCL_PATCH_VERSION;
27 
28  bp::def("checkVersionAtLeast", &checkVersionAtLeast,
29  bp::args("major", "minor", "patch"),
30  "Checks if the current version of hpp-fcl is at least"
31  " the version provided by the input arguments.");
32 
33  bp::def("checkVersionAtMost", &checkVersionAtMost,
34  bp::args("major", "minor", "patch"),
35  "Checks if the current version of hpp-fcl is at most"
36  " the version provided by the input arguments.");
37 }
bool checkVersionAtMost(int major, int minor, int patch)
Definition: version.cc:15
void def(const char *name, Func func)
void exposeVersion()
Definition: version.cc:19
bool checkVersionAtLeast(int major, int minor, int patch)
Definition: version.cc:11


hpp-fcl
Author(s):
autogenerated on Fri Jun 2 2023 02:39:02