Skip to content

Commit

Permalink
Merge pull request #25 from nim65s/devel
Browse files Browse the repository at this point in the history
maintenance
  • Loading branch information
nim65s authored Dec 9, 2021
2 parents a65354d + 9d888d0 commit 50bdf62
Show file tree
Hide file tree
Showing 11 changed files with 34 additions and 25 deletions.
18 changes: 6 additions & 12 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ IF(NOT INSTALL_PYTHON_INTERFACE_ONLY)
SET(PROJECT_USE_CMAKE_EXPORT TRUE)
ENDIF(NOT INSTALL_PYTHON_INTERFACE_ONLY)
SET(CUSTOM_HEADER_DIR "${PROJECT_NAME}")
SET(CMAKE_CXX_STANDARD 11)
SET(CXX_DISABLE_WERROR TRUE)
SET(DOXYGEN_USE_MATHJAX YES)

Expand All @@ -32,28 +31,25 @@ INCLUDE(cmake/ide.cmake)
# Project definition
COMPUTE_PROJECT_ARGS(PROJECT_ARGS LANGUAGES CXX)
PROJECT(${PROJECT_NAME} ${PROJECT_ARGS})
SET(CMAKE_CXX_STANDARD 11)
CHECK_MINIMAL_CXX_STANDARD(11 ENFORCE)

# Project dependencies
ADD_PROJECT_DEPENDENCY(pinocchio REQUIRED PKG_CONFIG_REQUIRES "pinocchio >= 2.0.0")
ADD_PROJECT_DEPENDENCY(ndcurves 1.0.0 REQUIRED PKG_CONFIG_REQUIRES "ndcurves >= 0.5.1")
ADD_PROJECT_DEPENDENCY(pinocchio REQUIRED)
ADD_PROJECT_DEPENDENCY(ndcurves 1.0.0 REQUIRED)
IF(NOT CURVES_WITH_PINOCCHIO_SUPPORT)
MESSAGE(FATAL_ERROR "you need to use a ndcurves version compiled with pinocchio support")
ENDIF(NOT CURVES_WITH_PINOCCHIO_SUPPORT)
SET(BOOST_COMPONENTS unit_test_framework serialization)
ADD_PROJECT_DEPENDENCY(Boost REQUIRED COMPONENTS unit_test_framework serialization)

IF(BUILD_PYTHON_INTERFACE)
FINDPYTHON()
STRING(REGEX REPLACE "-" "_" PY_NAME ${CUSTOM_HEADER_DIR})
ADD_PROJECT_DEPENDENCY(eigenpy REQUIRED PKG_CONFIG_REQUIRES "eigenpy >= 1.6.12")
SET(BOOST_COMPONENTS ${BOOST_COMPONENTS} python)
SEARCH_FOR_BOOST_PYTHON(REQUIRED)
ADD_PROJECT_DEPENDENCY(eigenpy REQUIRED)
INCLUDE_DIRECTORIES(SYSTEM ${PYTHON_INCLUDE_DIRS})
STRING(REGEX REPLACE "-" "_" PY_NAME ${PROJECT_NAME})
SET(${PY_NAME}_INSTALL_DIR ${PYTHON_SITELIB}/${PY_NAME})
ENDIF(BUILD_PYTHON_INTERFACE)

SEARCH_FOR_BOOST()
INCLUDE_DIRECTORIES(SYSTEM ${Boost_INCLUDE_DIRS})

# Main Library

Expand All @@ -70,5 +66,3 @@ IF(NOT INSTALL_PYTHON_INTERFACE_ONLY)
ENDIF(NOT INSTALL_PYTHON_INTERFACE_ONLY)
ADD_SUBDIRECTORY(bindings)
ADD_SUBDIRECTORY(unittest)

PKG_CONFIG_APPEND_BOOST_LIBS(serialization)
2 changes: 1 addition & 1 deletion bindings/python/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ ADD_LIBRARY(${PY_NAME} SHARED ${${PROJECT_NAME}_PYTHON_SOURCES} ${${PROJECT_NAME

ADD_SOURCE_GROUP(${PROJECT_NAME}_PYTHON_SOURCES)

TARGET_LINK_LIBRARIES(${PY_NAME} ${PROJECT_NAME} ${Boost_SERIALIZATION_LIBRARIES} eigenpy::eigenpy)
TARGET_LINK_LIBRARIES(${PY_NAME} ${PROJECT_NAME} eigenpy::eigenpy)
TARGET_LINK_BOOST_PYTHON(${PY_NAME})

SET_TARGET_PROPERTIES(${PY_NAME} PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${PY_NAME} SOVERSION ${PROJECT_VERSION})
Expand Down
2 changes: 1 addition & 1 deletion cmake
Submodule cmake updated 50 files
+4 −0 .docs/pages/base.rst
+1 −0 .docs/pages/internal.rst
+11 −1 .github/workflows/cmake.yml
+1 −0 .gitignore
+37 −19 Config.cmake.in
+30 −0 _unittests/cpp/CMakeLists.txt
+1 −0 _unittests/cpp/include/jrl_cmakemodule/lib.hh
+7 −0 _unittests/cpp/src/lib.cc
+8 −0 _unittests/cpp/src/main.cc
+20 −0 _unittests/dependency/CMakeLists.txt
+11 −0 _unittests/macros.cmake
+20 −0 _unittests/python/CMakeLists.txt
+0 −0 _unittests/python/jrl_cmakemodule/python.py
+46 −0 _unittests/run_unit_tests.sh
+13 −1 base.cmake
+99 −81 boost.cmake
+98 −0 cxx-standard.cmake
+15 −0 cython/cython.cmake
+30 −3 cython/setup.in.py
+3 −3 dist.cmake
+15 −8 distcheck.cmake
+5 −5 doxygen.cmake
+0 −70 dynamic_graph/python-module-py.cc
+32 −0 dynamic_graph/python-module-py.cc.in
+3 −19 dynamic_graph/submodule/__init__.py.cmake
+12 −2 find-external/CppAD/Findcppad.cmake
+10 −1 find-external/CppAD/Findcppadcg.cmake
+28 −0 find-external/OpenMP/FindOpenMP.cmake
+1 −1 gtest/CMakeLists.txt.in
+7 −7 header.cmake
+2 −2 hpp.cmake
+1 −1 hpp/doc.cmake
+1 −1 idl.cmake
+115 −28 msvc-specific.cmake
+4 −1 msvc.vcxproj.user.in
+1 −1 openhrpcontroller.cmake
+1 −1 openrtm.cmake
+33 −7 package-config.cmake
+7 −7 pkg-config.cmake
+1 −0 post-project.cmake
+113 −51 python.cmake
+9 −0 release.cmake
+1 −1 sphinx.cmake
+15 −0 stubgen/CMakeLists.txt.in
+127 −0 stubs.cmake
+8 −0 test.cmake
+2 −2 uninstall.cmake
+29 −18 version-script.cmake
+3 −4 version.cmake
+4 −0 xacro.cmake
1 change: 1 addition & 0 deletions include/multicontact-api/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ SET(${PROJECT_NAME}_SCENARIO_HEADERS


SET(${PROJECT_NAME}_PYTHON_HEADERS
bindings/python/fwd.hpp
bindings/python/geometry/ellipsoid.hpp
bindings/python/geometry/expose-geometry.hpp
bindings/python/geometry/linear-cone.hpp
Expand Down
14 changes: 14 additions & 0 deletions include/multicontact-api/bindings/python/fwd.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#ifndef __multicontact_api_python_fwd_hpp__
#define __multicontact_api_python_fwd_hpp__


// Silence a warning about a deprecated use of boost bind by boost python
// at least fo boost 1.73 to 1.75
// ref. https://github.com/stack-of-tasks/tsid/issues/128
#define BOOST_BIND_GLOBAL_PLACEHOLDERS

#include <boost/python.hpp>

#undef BOOST_BIND_GLOBAL_PLACEHOLDERS

#endif // ifndef __multicontact_api_python_utils_printable_hpp__
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
#define __multicontact_api_python_geometry_ellipsoid_hpp__

#include <pinocchio/fwd.hpp>
#include <boost/python.hpp>

#include "multicontact-api/bindings/python/fwd.hpp"
#include "multicontact-api/geometry/ellipsoid.hpp"

namespace multicontact_api {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#ifndef __multicontact_api_python_serialization_archive_hpp__
#define __multicontact_api_python_serialization_archive_hpp__

#include <boost/python.hpp>
#include "multicontact-api/bindings/python/fwd.hpp"

namespace multicontact_api {
namespace python {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#ifndef __multicontact_api_python_utils_printable_hpp__
#define __multicontact_api_python_utils_printable_hpp__

#include <boost/python.hpp>
#include "multicontact-api/bindings/python/fwd.hpp"

namespace multicontact_api {
namespace python {
Expand Down
12 changes: 6 additions & 6 deletions include/multicontact-api/serialization/archive.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ struct Serializable {

public:
/// \brief Loads a Derived object from a text file.
void loadFromText(const std::string& filename) throw(std::invalid_argument) {
void loadFromText(const std::string& filename) {
std::ifstream ifs(filename.c_str());
if (ifs) {
boost::archive::text_iarchive ia(ifs);
Expand All @@ -53,7 +53,7 @@ struct Serializable {
}

/// \brief Saved a Derived object as a text file.
void saveAsText(const std::string& filename) const throw(std::invalid_argument) {
void saveAsText(const std::string& filename) const {
std::ofstream ofs(filename.c_str());
if (ofs) {
boost::archive::text_oarchive oa(ofs);
Expand All @@ -65,7 +65,7 @@ struct Serializable {
}

/// \brief Loads a Derived object from an XML file.
void loadFromXML(const std::string& filename, const std::string& tag_name) throw(std::invalid_argument) {
void loadFromXML(const std::string& filename, const std::string& tag_name) {
assert(!tag_name.empty());
std::ifstream ifs(filename.c_str());
if (ifs) {
Expand All @@ -78,7 +78,7 @@ struct Serializable {
}

/// \brief Saved a Derived object as an XML file.
void saveAsXML(const std::string& filename, const std::string& tag_name) const throw(std::invalid_argument) {
void saveAsXML(const std::string& filename, const std::string& tag_name) const {
assert(!tag_name.empty());
std::ofstream ofs(filename.c_str());
if (ofs) {
Expand All @@ -91,7 +91,7 @@ struct Serializable {
}

/// \brief Loads a Derived object from an binary file.
void loadFromBinary(const std::string& filename) throw(std::invalid_argument) {
void loadFromBinary(const std::string& filename) {
std::ifstream ifs(filename.c_str());
if (ifs) {
boost::archive::binary_iarchive ia(ifs);
Expand All @@ -103,7 +103,7 @@ struct Serializable {
}

/// \brief Saved a Derived object as an binary file.
void saveAsBinary(const std::string& filename) const throw(std::invalid_argument) {
void saveAsBinary(const std::string& filename) const {
std::ofstream ofs(filename.c_str());
if (ofs) {
boost::archive::binary_oarchive oa(ofs);
Expand Down
2 changes: 1 addition & 1 deletion unittest/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ SET(${PROJECT_NAME}_TESTS

FOREACH(TEST ${${PROJECT_NAME}_TESTS})
ADD_UNIT_TEST(${TEST} "${TEST}.cpp")
TARGET_LINK_LIBRARIES(${TEST} ${PROJECT_NAME} ${Boost_LIBRARIES})
TARGET_LINK_LIBRARIES(${TEST} ${PROJECT_NAME} Boost::unit_test_framework)
ENDFOREACH(TEST ${${PROJECT_NAME}_TESTS})

TARGET_COMPILE_DEFINITIONS(examples PRIVATE -DTEST_DATA_PATH="${CMAKE_CURRENT_SOURCE_DIR}/../examples/")
Expand Down
2 changes: 1 addition & 1 deletion unittest/python/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ SET(${PROJECT_NAME}_PYTHON_TESTS
trivial
geometry
scenario
serialization_examples
#serialization_examples
)

FOREACH(TEST ${${PROJECT_NAME}_PYTHON_TESTS})
Expand Down

0 comments on commit 50bdf62

Please sign in to comment.