Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Stack Of Tasks
eigenpy
Commits
33713e86
Verified
Commit
33713e86
authored
Nov 25, 2019
by
Justin Carpentier
Browse files
core/version: add version to the module
parent
72930d04
Changes
5
Hide whitespace changes
Inline
Side-by-side
CMakeLists.txt
View file @
33713e86
...
...
@@ -106,6 +106,7 @@ SET(${PROJECT_NAME}_HEADERS
include/eigenpy/stride.hpp
include/eigenpy/ref.hpp
include/eigenpy/details/rvalue_from_python_data.hpp
include/eigenpy/version.hpp
)
LIST
(
APPEND
${
PROJECT_NAME
}
_HEADERS
...
...
@@ -133,6 +134,7 @@ SET(${PROJECT_NAME}_SOURCES
src/angle-axis.cpp
src/quaternion.cpp
src/geometry-conversion.cpp
src/version.cpp
)
ADD_LIBRARY
(
${
PROJECT_NAME
}
SHARED
${${
PROJECT_NAME
}
_SOURCES
}
${${
PROJECT_NAME
}
_HEADERS
}
)
...
...
include/eigenpy/fwd.hpp
View file @
33713e86
...
...
@@ -6,6 +6,8 @@
#ifndef __eigenpy_fwd_hpp__
#define __eigenpy_fwd_hpp__
#include
"eigenpy/config.hpp"
#include
<boost/python.hpp>
#include
<Eigen/Core>
...
...
include/eigenpy/version.hpp
0 → 100644
View file @
33713e86
//
// Copyright (c) 2019 INRIA
//
#ifndef __eigenpy_version_hpp__
#define __eigenpy_version_hpp__
#include
"eigenpy/config.hpp"
#include
<string>
namespace
eigenpy
{
///
/// \brief Returns the current version of EigenPy as a string using
/// the following standard:
/// EIGENPY_MINOR_VERSION.EIGENPY_MINOR_VERSION.EIGENPY_PATCH_VERSION
///
std
::
string
printVersion
(
const
std
::
string
&
delimiter
=
"."
);
///
/// \brief Checks if the current version of EigenPy is at least the version provided
/// by the input arguments.
///
/// \param[in] major_version Major version to check.
/// \param[in] minor_version Minor version to check.
/// \param[in] patch_version Patch version to check.
///
/// \returns true if the current version of EigenPy is greater than the version provided
/// by the input arguments.
///
bool
checkVersionAtLeast
(
unsigned
int
major_version
,
unsigned
int
minor_version
,
unsigned
int
patch_version
);
}
#endif // __eigenpy_version_hpp__
src/eigenpy.cpp
View file @
33713e86
...
...
@@ -4,6 +4,7 @@
*/
#include
"eigenpy/eigenpy.hpp"
#include
"eigenpy/version.hpp"
namespace
eigenpy
{
...
...
@@ -12,6 +13,13 @@ namespace eigenpy
void
enableEigenPy
()
{
using
namespace
Eigen
;
bp
::
scope
().
attr
(
"__version__"
)
=
eigenpy
::
printVersion
();
bp
::
scope
().
attr
(
"__raw_version__"
)
=
bp
::
str
(
EIGENPY_VERSION
);
bp
::
def
(
"checkVersionAtLeast"
,
&
eigenpy
::
checkVersionAtLeast
,
bp
::
args
(
"major_version"
,
"minor_version"
,
"patch_version"
),
"Checks if the current version of EigenPy is at least the version provided by the input arguments."
);
Exception
::
registerException
();
bp
::
def
(
"setNumpyType"
,
&
NumpyType
::
setNumpyType
,
...
...
src/version.cpp
0 → 100644
View file @
33713e86
//
// Copyright (c) 2019 INRIA
//
#include
"eigenpy/config.hpp"
#include
"eigenpy/version.hpp"
#include
<sstream>
namespace
eigenpy
{
std
::
string
printVersion
(
const
std
::
string
&
delimiter
)
{
std
::
ostringstream
oss
;
oss
<<
EIGENPY_MAJOR_VERSION
<<
delimiter
<<
EIGENPY_MINOR_VERSION
<<
delimiter
<<
EIGENPY_PATCH_VERSION
;
return
oss
.
str
();
}
bool
checkVersionAtLeast
(
unsigned
int
major_version
,
unsigned
int
minor_version
,
unsigned
int
patch_version
)
{
return
EIGENPY_VERSION_AT_LEAST
(
major_version
,
minor_version
,
patch_version
);
}
}
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment