...
 
Commits (17)
# Copyright 2010-2019, Florent Lamiraux, Thomas Moulard, Guilhem Saurel, JRL, CNRS/AIST, LAAS-CNRS # Copyright 2010-2020, Florent Lamiraux, Thomas Moulard, Olivier Stasse, Guilhem Saurel, JRL, CNRS/AIST, LAAS-CNRS
CMAKE_MINIMUM_REQUIRED(VERSION 2.8) CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
...@@ -7,37 +7,41 @@ SET(PROJECT_NAME dynamic-graph-python) ...@@ -7,37 +7,41 @@ SET(PROJECT_NAME dynamic-graph-python)
SET(PROJECT_DESCRIPTION "Dynamic graph library Python bindings") SET(PROJECT_DESCRIPTION "Dynamic graph library Python bindings")
SET(PROJECT_URL "http://github.com/${PROJECT_NAMESPACE}/${PROJECT_NAME}") SET(PROJECT_URL "http://github.com/${PROJECT_NAMESPACE}/${PROJECT_NAME}")
SET(PROJECT_USE_CMAKE_EXPORT TRUE)
SET(CUSTOM_HEADER_DIR "dynamic-graph/python")
SET(CXX_DISABLE_WERROR TRUE)
SET(DOXYGEN_USE_MATHJAX YES)
INCLUDE(cmake/base.cmake) INCLUDE(cmake/base.cmake)
INCLUDE(cmake/boost.cmake) INCLUDE(cmake/boost.cmake)
INCLUDE(cmake/eigen.cmake) INCLUDE(cmake/eigen.cmake)
include(cmake/python.cmake) INCLUDE(cmake/python.cmake)
include(cmake/test.cmake) INCLUDE(cmake/test.cmake)
INCLUDE(cmake/sphinx.cmake) INCLUDE(cmake/sphinx.cmake)
SET(DOXYGEN_USE_MATHJAX YES)
SET(CUSTOM_HEADER_DIR "dynamic-graph/python")
SET(PKG_CONFIG_ADDITIONAL_VARIABLES plugindir ${PKG_CONFIG_ADDITIONAL_VARIABLES}) SET(PKG_CONFIG_ADDITIONAL_VARIABLES plugindir ${PKG_CONFIG_ADDITIONAL_VARIABLES})
CMAKE_POLICY(SET CMP0048 OLD) COMPUTE_PROJECT_ARGS(PROJECT_ARGS LANGUAGES CXX)
PROJECT(${PROJECT_NAME} CXX) PROJECT(${PROJECT_NAME} ${PROJECT_ARGS})
FINDPYTHON() FINDPYTHON()
INCLUDE_DIRECTORIES(SYSTEM ${PYTHON_INCLUDE_DIRS}) INCLUDE_DIRECTORIES(SYSTEM ${PYTHON_INCLUDE_DIRS})
# Trigger dependency to dynamic-graph. ADD_REQUIRED_DEPENDENCY(eigen3)
ADD_REQUIRED_DEPENDENCY("dynamic-graph >= 3.0.0") ADD_PROJECT_DEPENDENCY(dynamic-graph 3.8.1 REQUIRED)
# manually append to the .pc dependencies for now
# ref https://github.com/jrl-umi3218/jrl-cmakemodules/issues/320
_ADD_TO_LIST(_PKG_CONFIG_REQUIRES "dynamic-graph >= 3.8.1" ",")
# Add dependency toward dynamic graph library in pkg-config file.
PKG_CONFIG_APPEND_LIBS("dynamic-graph-python") PKG_CONFIG_APPEND_LIBS("dynamic-graph-python")
# Search for Boost. SET(BOOST_COMPONENTS filesystem system thread program_options unit_test_framework python)
SET(BOOST_COMPONENTS filesystem system thread program_options unit_test_framework)
SEARCH_FOR_BOOST() SEARCH_FOR_BOOST()
SEARCH_FOR_EIGEN()
ADD_SUBDIRECTORY(src) ADD_SUBDIRECTORY(src)
ADD_SUBDIRECTORY(include/${CUSTOM_HEADER_DIR}) ADD_SUBDIRECTORY(include/${CUSTOM_HEADER_DIR})
ADD_SUBDIRECTORY(doc) ADD_SUBDIRECTORY(doc)
ADD_SUBDIRECTORY(unitTesting) ADD_SUBDIRECTORY(unitTesting)
INSTALL(FILES package.xml DESTINATION share/${PROJECT_NAME})
Subproject commit a99dc925bde7b976ae1ed286d0ab38906c73dff5 Subproject commit 1dbbc6770a9c652f01df28e44b07fbd589c42ada
<package format="2">
<name>dynamic-graph-python</name>
<version>3.5.0</version>
<description>
Dynamic graph library Python bindings
</description>
<maintainer email="ostasse@laas.fr">Olivier Stasse</maintainer>
<license>BSD</license>
<url>http://github.com/stack-of-tasks/dynamic-graph-python</url>
<author>Nicolas Mansard</author>
<author>Olivier Stasse</author>
<build_depend>roscpp</build_depend>
<build_depend>dynamic-graph</build_depend>
<exec_depend>roscpp</exec_depend>
<exec_depend>dynamic-graph</exec_depend>
<build_export_depend>roscpp</build_export_depend>
<build_export_depend>dynamic-graph</build_export_depend>
<buildtool_depend>catkin</buildtool_depend>
<doc_depend>doxygen</doc_depend>
</package>
# Copyright 2010 - 2019, Florent Lamiraux, Thomas Moulard, Guilhem Saurel, JRL, CNRS/AIST, LAAS-CNRS # Copyright 2010-2020, Florent Lamiraux, Thomas Moulard, Olivier Stasse, Guilhem Saurel, JRL, CNRS/AIST, LAAS-CNRS
# #
# #
...@@ -9,16 +9,34 @@ ...@@ -9,16 +9,34 @@
SET(LIBRARY_NAME ${PROJECT_NAME}) SET(LIBRARY_NAME ${PROJECT_NAME})
ADD_LIBRARY(${LIBRARY_NAME} SHARED interpreter.cc dynamic_graph/python-compat.cc) ADD_LIBRARY(${LIBRARY_NAME} SHARED interpreter.cc dynamic_graph/python-compat.cc)
TARGET_INCLUDE_DIRECTORIES(${LIBRARY_NAME}
PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/src>
$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}/../include>
$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}/>
INTERFACE
$<INSTALL_INTERFACE:include>
)
TARGET_LINK_LIBRARIES(${LIBRARY_NAME} ${PYTHON_LIBRARY}) TARGET_LINK_LIBRARIES(${LIBRARY_NAME} ${PYTHON_LIBRARY})
IF(UNIX) IF(UNIX)
TARGET_LINK_LIBRARIES(${LIBRARY_NAME} ${CMAKE_DL_LIBS}) TARGET_LINK_LIBRARIES(${LIBRARY_NAME} ${Boost_LIBRARIES})
TARGET_LINK_LIBRARIES(${LIBRARY_NAME} ${Boost_PYTHON_LIBRARIES})
TARGET_LINK_LIBRARIES(${LIBRARY_NAME} ${CMAKE_DL_LIBS})
ENDIF(UNIX) ENDIF(UNIX)
SET_TARGET_PROPERTIES(${LIBRARY_NAME} PROPERTIES SOVERSION ${PROJECT_VERSION}) SET_TARGET_PROPERTIES(${LIBRARY_NAME} PROPERTIES SOVERSION ${PROJECT_VERSION})
PKG_CONFIG_USE_DEPENDENCY(${LIBRARY_NAME} dynamic-graph) TARGET_LINK_LIBRARIES(${LIBRARY_NAME} dynamic-graph::dynamic-graph)
INSTALL(TARGETS ${LIBRARY_NAME} DESTINATION lib) INSTALL(TARGETS ${LIBRARY_NAME}
EXPORT ${TARGETS_EXPORT_NAME}
PUBLIC_HEADER
INCLUDES DESTINATION include
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib
)
# #
# #
......
# Copyright 2010 - 2019, Florent Lamiraux, Thomas Moulard, Guilhem Saurel, JRL, CNRS/AIST, LAAS-CNRS # Copyright 2010-2020, Florent Lamiraux, Thomas Moulard, Olivier Stasse, Guilhem Saurel, JRL, CNRS/AIST, LAAS-CNRS
SET(PYTHON_MODULE wrap) SET(PYTHON_MODULE wrap)
...@@ -18,11 +18,12 @@ ADD_LIBRARY(${PYTHON_MODULE} ...@@ -18,11 +18,12 @@ ADD_LIBRARY(${PYTHON_MODULE}
) )
TARGET_LINK_LIBRARIES(${PYTHON_MODULE} ${PYTHON_LIBRARY}) TARGET_LINK_LIBRARIES(${PYTHON_MODULE} ${PYTHON_LIBRARY})
TARGET_LINK_LIBRARIES(${PYTHON_MODULE} dynamic-graph::dynamic-graph)
# Remove prefix lib # Remove prefix lib
SET_TARGET_PROPERTIES(${PYTHON_MODULE} SET_TARGET_PROPERTIES(${PYTHON_MODULE}
PROPERTIES PREFIX "") PROPERTIES PREFIX "")
PKG_CONFIG_USE_DEPENDENCY(${PYTHON_MODULE} dynamic-graph) INSTALL(TARGETS ${PYTHON_MODULE}
EXPORT ${TARGETS_EXPORT_NAME}
INSTALL(TARGETS ${PYTHON_MODULE} DESTINATION ${PYTHON_SITELIB}/dynamic_graph) DESTINATION ${PYTHON_SITELIB}/dynamic_graph)
...@@ -260,13 +260,15 @@ class Entity(object): ...@@ -260,13 +260,15 @@ class Entity(object):
def setLoggerVerbosityLevel(self, verbosity): def setLoggerVerbosityLevel(self, verbosity):
""" """
Specify for the entity the verbosity level Specify for the entity the verbosity level.
- param verbosity should be one of the attribute of the enum
dynamic_graph.entity.VerbosityLevel
""" """
return wrap.entity_set_logger_verbosity(self.obj, verbosity) return wrap.entity_set_logger_verbosity(self.obj, verbosity)
def getLoggerVerbosityLevel(self): def getLoggerVerbosityLevel(self):
""" """
Returns the entity's verbosity level Returns the entity's verbosity level (as a dynamic_graph.entity.VerbosityLevel)
""" """
r = wrap.entity_get_logger_verbosity(self.obj) r = wrap.entity_get_logger_verbosity(self.obj)
if r == 0: if r == 0:
......
# Copyright 2010-2020, Florent Lamiraux, Thomas Moulard, Olivier Stasse, Guilhem Saurel, JRL, CNRS/AIST, LAAS-CNRS
# Test the interpreter # Test the interpreter
SET(EXECUTABLE_NAME interpreter-test) SET(EXECUTABLE_NAME interpreter-test)
ADD_EXECUTABLE(${EXECUTABLE_NAME} interpreter-test.cc) ADD_EXECUTABLE(${EXECUTABLE_NAME} interpreter-test.cc)
...@@ -10,7 +10,7 @@ SET(EXECUTABLE_NAME interpreter-test-runfile) ...@@ -10,7 +10,7 @@ SET(EXECUTABLE_NAME interpreter-test-runfile)
ADD_EXECUTABLE(${EXECUTABLE_NAME} interpreter-test-runfile.cc) ADD_EXECUTABLE(${EXECUTABLE_NAME} interpreter-test-runfile.cc)
TARGET_LINK_LIBRARIES(${EXECUTABLE_NAME} dynamic-graph-python) TARGET_LINK_LIBRARIES(${EXECUTABLE_NAME} dynamic-graph-python)
TARGET_LINK_LIBRARIES(${EXECUTABLE_NAME} ${PYTHON_LIBRARY}) TARGET_LINK_LIBRARIES(${EXECUTABLE_NAME} ${PYTHON_LIBRARY})
TARGET_LINK_BOOST_PYTHON(${EXECUTABLE_NAME}) TARGET_LINK_LIBRARIES(${EXECUTABLE_NAME} ${Boost_LIBRARIES})
ADD_TEST(${EXECUTABLE_NAME} ${EXECUTABLE_NAME}) ADD_TEST(${EXECUTABLE_NAME} ${EXECUTABLE_NAME})
ADD_CUSTOM_COMMAND(TARGET interpreter-test-runfile POST_BUILD ADD_CUSTOM_COMMAND(TARGET interpreter-test-runfile POST_BUILD
...@@ -35,7 +35,8 @@ SET_TARGET_PROPERTIES(${LIBRARY_NAME} ...@@ -35,7 +35,8 @@ SET_TARGET_PROPERTIES(${LIBRARY_NAME}
PREFIX "" PREFIX ""
SOVERSION ${PROJECT_VERSION} SOVERSION ${PROJECT_VERSION}
INSTALL_RPATH ${DYNAMIC_GRAPH_PLUGINDIR}) INSTALL_RPATH ${DYNAMIC_GRAPH_PLUGINDIR})
PKG_CONFIG_USE_DEPENDENCY(${LIBRARY_NAME} dynamic-graph)
target_link_libraries(${LIBRARY_NAME} dynamic-graph::dynamic-graph)
## Create its bindings ## Create its bindings
## This mimics DYNAMIC_GRAPH_PYTHON_MODULE(${LIBRARY_NAME} ${LIBRARY_NAME} "${LIBRARY_NAME}-wrap") ## This mimics DYNAMIC_GRAPH_PYTHON_MODULE(${LIBRARY_NAME} ${LIBRARY_NAME} "${LIBRARY_NAME}-wrap")
......