Skip to content

Commit 9c2a51a

Browse files
authored
Merge pull request #129 from nim65s/issue/128
define locally BOOST_BIND_GLOBAL_PLACEHOLDERS, fix #128
2 parents c0ea6bf + bf3b3ad commit 9c2a51a

24 files changed

+61
-113
lines changed

CMakeLists.txt

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -86,12 +86,6 @@ IF(BUILD_PYTHON_INTERFACE)
8686
SET(PYWRAP ${PROJECT_NAME}_pywrap)
8787
ADD_PROJECT_DEPENDENCY(eigenpy REQUIRED PKG_CONFIG_REQUIRES eigenpy)
8888
SEARCH_FOR_BOOST_PYTHON(REQUIRED)
89-
90-
IF(Boost_VERSION GREATER 107299)
91-
# Silence a warning about a deprecated use of boost bind by boost python
92-
# at least fo boost 1.73 to 1.75
93-
ADD_DEFINITIONS(-DBOOST_BIND_GLOBAL_PLACEHOLDERS)
94-
ENDIF()
9589
ENDIF(BUILD_PYTHON_INTERFACE)
9690

9791
# Main Library
@@ -163,6 +157,7 @@ SET(${PROJECT_NAME}_FORMULATIONS_HEADERS
163157
)
164158

165159
FILE(GLOB ${PYWRAP}_HEADERS
160+
include/tsid/bindings/python/fwd.hpp
166161
include/tsid/bindings/python/constraint/*.hpp
167162
include/tsid/bindings/python/contacts/*.hpp
168163
include/tsid/bindings/python/formulations/*.hpp

bindings/python/module.cpp

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,7 @@
1515
// <http://www.gnu.org/licenses/>.
1616
//
1717

18-
#include <pinocchio/fwd.hpp>
19-
#include <eigenpy/eigenpy.hpp>
18+
#include "tsid/bindings/python/fwd.hpp"
2019
#include <eigenpy/geometry.hpp>
2120

2221
#include "tsid/bindings/python/robots/expose-robots.hpp"
@@ -27,11 +26,6 @@
2726
#include "tsid/bindings/python/solvers/expose-solvers.hpp"
2827
#include "tsid/bindings/python/formulations/expose-formulations.hpp"
2928

30-
#include <boost/python/module.hpp>
31-
#include <boost/python/def.hpp>
32-
#include <boost/python/tuple.hpp>
33-
#include <boost/python/to_python_converter.hpp>
34-
3529
namespace bp = boost::python;
3630
using namespace tsid::python;
3731

@@ -62,4 +56,3 @@ BOOST_PYTHON_MODULE(libtsid_pywrap)
6256
exposeFormulations();
6357

6458
}
65-

include/tsid/bindings/python/constraint/constraint-bound.hpp

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,7 @@
1919
#ifndef __tsid_python_constriant_bound_hpp__
2020
#define __tsid_python_constriant_bound_hpp__
2121

22-
#include <boost/python.hpp>
23-
#include <string>
24-
#include <eigenpy/eigenpy.hpp>
25-
#include <boost/python/suite/indexing/vector_indexing_suite.hpp>
22+
#include "tsid/bindings/python/fwd.hpp"
2623

2724
#include "tsid/math/constraint-bound.hpp"
2825

include/tsid/bindings/python/constraint/constraint-equality.hpp

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,7 @@
1919
#ifndef __tsid_python_constriant_equality_hpp__
2020
#define __tsid_python_constriant_equality_hpp__
2121

22-
#include <boost/python.hpp>
23-
#include <string>
24-
#include <eigenpy/eigenpy.hpp>
25-
#include <boost/python/suite/indexing/vector_indexing_suite.hpp>
22+
#include "tsid/bindings/python/fwd.hpp"
2623

2724
#include "tsid/math/constraint-equality.hpp"
2825

include/tsid/bindings/python/constraint/constraint-inequality.hpp

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,7 @@
1717
#ifndef __tsid_python_constriant_inequality_hpp__
1818
#define __tsid_python_constriant_inequality_hpp__
1919

20-
#include <boost/python.hpp>
21-
#include <string>
22-
#include <eigenpy/eigenpy.hpp>
23-
#include <boost/python/suite/indexing/vector_indexing_suite.hpp>
20+
#include "tsid/bindings/python/fwd.hpp"
2421

2522
#include "tsid/math/constraint-inequality.hpp"
2623

include/tsid/bindings/python/contacts/contact-6d.hpp

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,7 @@
1818
#ifndef __tsid_python_contact_6d_hpp__
1919
#define __tsid_python_contact_6d_hpp__
2020

21-
#include <pinocchio/fwd.hpp>
22-
#include <boost/python.hpp>
23-
#include <string>
24-
#include <eigenpy/eigenpy.hpp>
25-
#include <boost/python/suite/indexing/vector_indexing_suite.hpp>
21+
#include "tsid/bindings/python/fwd.hpp"
2622

2723
#include "tsid/contacts/contact-6d.hpp"
2824
#include "tsid/robots/robot-wrapper.hpp"

include/tsid/bindings/python/contacts/contact-point.hpp

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,7 @@
1818
#ifndef __tsid_python_contact_6d_hpp__
1919
#define __tsid_python_contact_6d_hpp__
2020

21-
#include <pinocchio/fwd.hpp>
22-
#include <boost/python.hpp>
23-
#include <string>
24-
#include <eigenpy/eigenpy.hpp>
25-
#include <boost/python/suite/indexing/vector_indexing_suite.hpp>
21+
#include "tsid/bindings/python/fwd.hpp"
2622

2723
#include "tsid/contacts/contact-point.hpp"
2824
#include "tsid/robots/robot-wrapper.hpp"

include/tsid/bindings/python/formulations/formulation.hpp

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,7 @@
1818
#ifndef __tsid_python_HQPOutput_hpp__
1919
#define __tsid_python_HQPOutput_hpp__
2020

21-
#include <pinocchio/fwd.hpp>
22-
#include <boost/python.hpp>
23-
#include <string>
24-
#include <eigenpy/eigenpy.hpp>
25-
#include <boost/python/suite/indexing/vector_indexing_suite.hpp>
21+
#include "tsid/bindings/python/fwd.hpp"
2622

2723
#include <pinocchio/bindings/python/utils/deprecation.hpp>
2824

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
//
2+
// Copyright (c) 2021 CNRS - INRIA
3+
//
4+
// This file is part of tsid
5+
// tsid is free software: you can redistribute it
6+
// and/or modify it under the terms of the GNU Lesser General Public
7+
// License as published by the Free Software Foundation, either version
8+
// 3 of the License, or (at your option) any later version.
9+
// tsid is distributed in the hope that it will be
10+
// useful, but WITHOUT ANY WARRANTY; without even the implied warranty
11+
// of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12+
// General Lesser Public License for more details. You should have
13+
// received a copy of the GNU Lesser General Public License along with
14+
// tsid If not, see
15+
// <http://www.gnu.org/licenses/>.
16+
//
17+
18+
#ifndef __tsid_python_fwd_hpp__
19+
#define __tsid_python_fwd_hpp__
20+
21+
#include <string>
22+
23+
// Silence a warning about a deprecated use of boost bind by boost python
24+
// at least fo boost 1.73 to 1.75
25+
// ref. https://github.com/stack-of-tasks/tsid/issues/128
26+
#define BOOST_BIND_GLOBAL_PLACEHOLDERS
27+
28+
#include <pinocchio/fwd.hpp>
29+
#include <eigenpy/eigenpy.hpp>
30+
31+
#include <boost/python.hpp>
32+
#include <boost/python/suite/indexing/vector_indexing_suite.hpp>
33+
#include <boost/python/make_constructor.hpp>
34+
35+
#undef BOOST_BIND_GLOBAL_PLACEHOLDERS
36+
37+
#endif

include/tsid/bindings/python/robots/robot-wrapper.hpp

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,7 @@
1818
#ifndef __tsid_python_robot_wrapper_hpp__
1919
#define __tsid_python_robot_wrapper_hpp__
2020

21-
#include <pinocchio/fwd.hpp>
22-
#include <boost/python.hpp>
23-
#include <string>
24-
#include <eigenpy/eigenpy.hpp>
25-
#include <boost/python/suite/indexing/vector_indexing_suite.hpp>
26-
#include <boost/python/make_constructor.hpp>
21+
#include "tsid/bindings/python/fwd.hpp"
2722

2823
#include "tsid/robots/robot-wrapper.hpp"
2924

0 commit comments

Comments
 (0)