Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
D
dynamic_graph_bridge
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Guilhem Saurel
dynamic_graph_bridge
Commits
1faa8bf7
Commit
1faa8bf7
authored
Aug 17, 2018
by
Guilhem Saurel
Browse files
Options
Downloads
Patches
Plain Diff
[CMake] add BUILD_PYTHON_INTERFACE option
parent
918b8f67
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
CMakeLists.txt
+53
-35
53 additions, 35 deletions
CMakeLists.txt
src/CMakeLists.txt
+8
-3
8 additions, 3 deletions
src/CMakeLists.txt
with
61 additions
and
38 deletions
CMakeLists.txt
+
53
−
35
View file @
1faa8bf7
...
...
@@ -29,14 +29,27 @@ include(cmake/python.cmake)
project
(
dynamic_graph_bridge
)
find_package
(
catkin
REQUIRED
COMPONENTS roscpp
rospy
std_msgs message_generation std_srvs geometry_msgs sensor_msgs tf
)
find_package
(
realtime_tools
)
SET
(
CATKIN_
REQUIRED
_
COMPONENTS roscpp std_msgs message_generation std_srvs geometry_msgs sensor_msgs tf
)
SET
(
CATKIN_DEPENDS_LIBRARIES ros_bridge sot_loader
)
## LAAS cmake submodule part
set
(
PROJECT_DESCRIPTION
"Dynamic graph bridge library"
)
set
(
PROJECT_NAME dynamic_graph_bridge
)
set
(
PROJECT_URL
""
)
OPTION
(
BUILD_PYTHON_INTERFACE
"Build the python binding"
ON
)
IF
(
BUILD_PYTHON_INTERFACE
)
FINDPYTHON
()
STRING
(
REGEX REPLACE
"-"
"_"
PY_NAME
${
PROJECT_NAME
}
)
INCLUDE_DIRECTORIES
(
${
PYTHON_INCLUDE_DIRS
}
)
ADD_REQUIRED_DEPENDENCY
(
"dynamic-graph-python >= 3.0.0"
)
SET
(
CATKIN_REQUIRED_COMPONENTS
${
CATKIN_REQUIRED_COMPONENTS rospy)
SET(CATKIN_DEPENDS_LIBRARIES
${
CATKIN_DEPENDS_LIBRARIES ros_interpreter)
ENDIF(BUILD_PYTHON_INTERFACE)
find_package(catkin REQUIRED COMPONENTS
${
CATKIN_REQUIRED_COMPONENTS)
find_package(realtime_tools)
set(CXX_DISABLE_WERROR False)
set(CUSTOM_HEADER_DIR dynamic_graph_bridge)
set(
${
PROJECT_NAME
}
_HEADERS
...
...
@@ -70,7 +83,6 @@ add_required_dependency("realtime_tools >= 1.8")
add_required_dependency(tf2_bullet)
ADD_REQUIRED_DEPENDENCY("pinocchio")
ADD_REQUIRED_DEPENDENCY("dynamic-graph >= 3.0.0")
ADD_REQUIRED_DEPENDENCY
(
"dynamic-graph-python >= 3.0.0"
)
ADD_REQUIRED_DEPENDENCY("sot-dynamic-pinocchio >= 3.0.0")
ADD_REQUIRED_DEPENDENCY("sot-core >= 3.0.0")
ADD_REQUIRED_DEPENDENCY("sot-tools >= 2.0.0")
...
...
@@ -116,10 +128,12 @@ macro(compile_plugin NAME)
install(TARGETS
${
NAME
}
DESTINATION lib/plugin)
IF(BUILD_PYTHON_INTERFACE)
dynamic_graph_python_module("ros/
${
NAME
}
"
${
NAME
}
ros/
${
NAME
}
/wrap
)
ENDIF(BUILD_PYTHON_INTERFACE)
PKG_CONFIG_USE_DEPENDENCY(ros/
${
NAME
}
/wrap realtime_tools)
PKG_CONFIG_USE_DEPENDENCY(ros/
${
NAME
}
/wrap dynamic_graph)
...
...
@@ -127,8 +141,6 @@ macro(compile_plugin NAME)
PKG_CONFIG_USE_DEPENDENCY(ros/
${
NAME
}
/wrap dynamic_graph_bridge_msgs)
endmacro()
#include(cmake/python.cmake)
# Build Sot Entities
compile_plugin(ros_publish)
compile_plugin(ros_subscribe)
...
...
@@ -144,6 +156,7 @@ target_link_libraries(ros_publish ros_bridge)
#compile_plugin(robot_model)
# ros_interperter library.
IF(BUILD_PYTHON_INTERFACE)
add_library(ros_interpreter src/ros_interpreter.cpp)
pkg_config_use_dependency(ros_interpreter dynamic-graph)
pkg_config_use_dependency(ros_interpreter sot-core)
...
...
@@ -167,6 +180,7 @@ pkg_config_use_dependency(interpreter sot-dynamic-pinocchio)
pkg_config_use_dependency(interpreter dynamic_graph_bridge_msgs)
# set_target_properties(interpreter PROPERTIES BUILD_WITH_INSTALL_RPATH True)
#install(TARGETS interpreter DESTINATION bin)
ENDIF(BUILD_PYTHON_INTERFACE)
# Stand alone embedded intepreter with a robot controller.
add_executable(geometric_simu src/geometric_simu.cpp src/sot_loader.cpp src/sot_loader_basic.cpp)
...
...
@@ -186,14 +200,18 @@ add_subdirectory(src)
add_service_files( FILES RunPythonFile.srv )
generate_messages( DEPENDENCIES std_msgs )
# This is necessary so that the pc file generated by catking is similar to the on
# done directly by jrl-cmake-modules
catkin_package(CATKIN_DEPENDS message_runtime roscpp realtime_tools tf2_bullet
${
SOT_PKGNAMES
}
tf
LIBRARIES
ros_bridge ros_interpreter sot_loader
LIBRARIES
${
CATKIN_DEPENDS_LIBRARIES
}
)
# Add libraries in pc file generated by cmake submodule
PKG_CONFIG_APPEND_LIBS
(
ros_bridge ros_interpreter sot_loader
)
PKG_CONFIG_APPEND_LIBS(ros_bridge sot_loader)
IF(BUILD_PYTHON_INTERFACE)
PKG_CONFIG_APPEND_LIBS(ros_interpreter)
ENDIF(BUILD_PYTHON_INTERFACE)
#install ros executables
install(PROGRAMS
...
...
...
...
This diff is collapsed.
Click to expand it.
src/CMakeLists.txt
+
8
−
3
View file @
1faa8bf7
PYTHON_INSTALL
(
"dynamic_graph/ros"
"__init__.py"
"
${
PYTHON_SITELIB
}
"
)
PYTHON_INSTALL
(
"dynamic_graph/ros"
"ros.py"
"
${
PYTHON_SITELIB
}
"
)
PYTHON_INSTALL
(
"dynamic_graph/ros"
"dgcompleter.py"
"
${
PYTHON_SITELIB
}
"
)
IF
(
BUILD_PYTHON_INTERFACE
)
INSTALL
(
FILES
"dynamic_graph/ros/__init__.py"
"dynamic_graph/ros/ros.py"
"dynamic_graph/ros/dgcompleter.py"
DESTINATION
"
${
PYTHON_SITELIB
}
/dynamic_graph/ros"
)
ENDIF
(
BUILD_PYTHON_INTERFACE
)
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment