Skip to content
This repository was archived by the owner on Nov 28, 2025. It is now read-only.

Commit d4c9754

Browse files
committed
[CMake] fix build with python
1 parent d304407 commit d4c9754

File tree

1 file changed

+11
-12
lines changed

1 file changed

+11
-12
lines changed

CMakeLists.txt

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,17 @@ ADD_REQUIRED_DEPENDENCY("dynamic-graph >= 3.0.0")
4747
ADD_REQUIRED_DEPENDENCY("sot-core >= 3.0.0")
4848
ADD_REQUIRED_DEPENDENCY("sot-tools >= 2.0.0")
4949

50+
SET(BOOST_COMPONENTS filesystem system unit_test_framework)
51+
52+
OPTION (BUILD_PYTHON_INTERFACE "Build the python binding" ON)
53+
IF(BUILD_PYTHON_INTERFACE)
54+
FINDPYTHON()
55+
ADD_REQUIRED_DEPENDENCY("dynamic-graph-python >= 3.0.0")
56+
SET(BOOST_COMPONENTS ${BOOST_COMPONENTS} python)
57+
INCLUDE_DIRECTORIES(${PYTHON_INCLUDE_PATH})
58+
ENDIF(BUILD_PYTHON_INTERFACE)
59+
60+
5061
# List plug-ins that will be compiled.
5162
SET(plugins
5263
zmpreffromcom
@@ -66,18 +77,6 @@ LIST(APPEND plugins dynamic)
6677
# Add dependency toward sot-dynamic-pinocchio library in pkg-config file.
6778
PKG_CONFIG_APPEND_LIBS(${LIBRARY_NAME})
6879

69-
# Search for dependencies.
70-
# Boost
71-
SET(BOOST_COMPONENTS filesystem system unit_test_framework)
72-
73-
OPTION (BUILD_PYTHON_INTERFACE "Build the python binding" ON)
74-
IF(BUILD_PYTHON_INTERFACE)
75-
FINDPYTHON()
76-
ADD_REQUIRED_DEPENDENCY("dynamic-graph-python >= 3.0.0")
77-
SET(BOOST_COMPONENTS ${BOOST_COMPONENTS} python)
78-
INCLUDE_DIRECTORIES(${PYTHON_INCLUDE_PATH})
79-
ENDIF(BUILD_PYTHON_INTERFACE)
80-
8180
SEARCH_FOR_BOOST()
8281
SEARCH_FOR_EIGEN()
8382

0 commit comments

Comments
 (0)