Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
pinocchio
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
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Stack Of Tasks
pinocchio
Commits
66411afe
Commit
66411afe
authored
8 years ago
by
jcarpent
Browse files
Options
Downloads
Patches
Plain Diff
[CMake] Move conditionnal to parent directory
parent
68639855
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
bindings/CMakeLists.txt
+3
-1
3 additions, 1 deletion
bindings/CMakeLists.txt
bindings/python/CMakeLists.txt
+140
-142
140 additions, 142 deletions
bindings/python/CMakeLists.txt
with
143 additions
and
143 deletions
bindings/CMakeLists.txt
+
3
−
1
View file @
66411afe
...
@@ -14,4 +14,6 @@
...
@@ -14,4 +14,6 @@
# pinocchio If not, see
# pinocchio If not, see
# <http://www.gnu.org/licenses/>.
# <http://www.gnu.org/licenses/>.
ADD_SUBDIRECTORY
(
python
)
IF
(
BUILD_PYTHON_INTERFACE
)
ADD_SUBDIRECTORY
(
python
)
ENDIF
(
BUILD_PYTHON_INTERFACE
)
This diff is collapsed.
Click to expand it.
bindings/python/CMakeLists.txt
+
140
−
142
View file @
66411afe
...
@@ -51,149 +51,147 @@ MACRO(SYMLINK_AND_INSTALL_HEADERS HEADERS SUBPATH)
...
@@ -51,149 +51,147 @@ MACRO(SYMLINK_AND_INSTALL_HEADERS HEADERS SUBPATH)
ENDMACRO
(
SYMLINK_AND_INSTALL_HEADERS HEADERS SUBPATH
)
ENDMACRO
(
SYMLINK_AND_INSTALL_HEADERS HEADERS SUBPATH
)
# --- LIBRARY --- #
# --- LIBRARY --- #
IF
(
BUILD_PYTHON_INTERFACE
)
SET
(
${
PROJECT_NAME
}
_PYTHON_HEADERS
eigen_container.hpp
handler.hpp
python.hpp
se3.hpp
force.hpp
motion.hpp
inertia.hpp
joints-models.hpp
joints-variant.hpp
joint.hpp
joint-derived.hpp
frame.hpp
model.hpp
data.hpp
algorithm/algorithms.hpp
parsers.hpp
explog.hpp
geometry-object.hpp
geometry-model.hpp
geometry-data.hpp
)
SET
(
${
PROJECT_NAME
}
_PARSER_PYTHON_HEADERS
parsers/python.hpp
)
SET
(
${
PROJECT_NAME
}
_PARSER_PYTHON_SOURCES
parsers/python/model.cpp
)
SET
(
${
PROJECT_NAME
}
_PYTHON_SOURCES
module.cpp
expose-SE3.cpp
expose-motion.cpp
expose-force.cpp
expose-inertia.cpp
expose-explog.cpp
expose-joints.cpp
expose-frame.cpp
expose-model.cpp
expose-data.cpp
expose-parsers.cpp
algorithm/expose-algorithms.cpp
algorithm/expose-com.cpp
algorithm/expose-kinematics.cpp
algorithm/expose-dynamics.cpp
algorithm/expose-crba.cpp
algorithm/expose-rnea.cpp
algorithm/expose-aba.cpp
algorithm/expose-jacobian.cpp
algorithm/expose-joints.cpp
algorithm/expose-energy.cpp
algorithm/expose-frames.cpp
algorithm/expose-cat.cpp
)
LIST
(
APPEND
${
PROJECT_NAME
}
_PYTHON_HEADERS
geometry-object.hpp
geometry-model.hpp
geometry-data.hpp
)
LIST
(
APPEND
${
PROJECT_NAME
}
_PYTHON_SOURCES
expose-geometry.cpp
algorithm/expose-geometry.cpp
)
LIST
(
APPEND HEADERS
${${
PROJECT_NAME
}
_PYTHON_HEADERS
}
)
LIST
(
REMOVE_DUPLICATES HEADERS
)
# Headers of the python binding
MAKE_DIRECTORY
(
"
${${
PROJECT_NAME
}
_BINARY_DIR
}
/include/pinocchio/bindings/python"
)
MAKE_DIRECTORY
(
"
${${
PROJECT_NAME
}
_BINARY_DIR
}
/include/pinocchio/bindings/python/algorithm"
)
SYMLINK_AND_INSTALL_HEADERS
(
"
${${
PROJECT_NAME
}
_PYTHON_HEADERS
}
"
"bindings/python"
)
# Headers of the python parser
MAKE_DIRECTORY
(
"
${${
PROJECT_NAME
}
_BINARY_DIR
}
/include/pinocchio/parsers/python"
)
SYMLINK_AND_INSTALL_HEADERS
(
"
${${
PROJECT_NAME
}
_PARSER_PYTHON_HEADERS
}
"
""
)
# --- COMPILE WRAPPER
MAKE_DIRECTORY
(
"
${${
PROJECT_NAME
}
_BINARY_DIR
}
/lib/python/
${
PROJECT_NAME
}
"
)
SET
(
${
PYWRAP
}
_SOURCES
${${
PROJECT_NAME
}
_PYTHON_SOURCES
}
${${
PROJECT_NAME
}
_PARSER_PYTHON_SOURCES
}
)
SET
(
${
PYWRAP
}
_HEADERS
${${
PROJECT_NAME
}
_PYTHON_HEADERS
}
${${
PROJECT_NAME
}
_PARSER_PYTHON_HEADERS
}
)
ADD_LIBRARY
(
${
PYWRAP
}
SHARED
${${
PYWRAP
}
_SOURCES
}
${${
PYWRAP
}
_HEADERS
}
)
ADD_HEADER_GROUP
(
${
PYWRAP
}
_PYTHON_HEADERS
)
ADD_SOURCE_GROUP
(
${
PYWRAP
}
_PYTHON_SOURCES
)
PKG_CONFIG_USE_DEPENDENCY
(
${
PYWRAP
}
eigenpy
)
TARGET_LINK_LIBRARIES
(
${
PYWRAP
}
${
PROJECT_NAME
}
)
TARGET_LINK_BOOST_PYTHON
(
${
PYWRAP
}
)
IF
(
APPLE
)
# We need to change the extension for python bindings
SET_TARGET_PROPERTIES
(
${
PYWRAP
}
PROPERTIES SUFFIX
".so"
)
ENDIF
(
APPLE
)
SET_TARGET_PROPERTIES
(
${
PYWRAP
}
PROPERTIES
LIBRARY_OUTPUT_DIRECTORY
"
${
CMAKE_BINARY_DIR
}
/lib/python/
${
PROJECT_NAME
}
"
)
SET
(
${
PROJECT_NAME
}
_PYTHON_HEADERS
eigen_container.hpp
handler.hpp
python.hpp
se3.hpp
force.hpp
motion.hpp
inertia.hpp
joints-models.hpp
joints-variant.hpp
joint.hpp
joint-derived.hpp
frame.hpp
model.hpp
data.hpp
algorithm/algorithms.hpp
parsers.hpp
explog.hpp
geometry-object.hpp
geometry-model.hpp
geometry-data.hpp
)
SET
(
${
PROJECT_NAME
}
_PARSER_PYTHON_HEADERS
parsers/python.hpp
)
SET
(
${
PROJECT_NAME
}
_PARSER_PYTHON_SOURCES
parsers/python/model.cpp
)
SET
(
${
PROJECT_NAME
}
_PYTHON_SOURCES
module.cpp
expose-SE3.cpp
expose-motion.cpp
expose-force.cpp
expose-inertia.cpp
expose-explog.cpp
expose-joints.cpp
expose-frame.cpp
expose-model.cpp
expose-data.cpp
expose-parsers.cpp
algorithm/expose-algorithms.cpp
algorithm/expose-com.cpp
algorithm/expose-kinematics.cpp
algorithm/expose-dynamics.cpp
algorithm/expose-crba.cpp
algorithm/expose-rnea.cpp
algorithm/expose-aba.cpp
algorithm/expose-jacobian.cpp
algorithm/expose-joints.cpp
algorithm/expose-energy.cpp
algorithm/expose-frames.cpp
algorithm/expose-cat.cpp
)
LIST
(
APPEND
${
PROJECT_NAME
}
_PYTHON_HEADERS
geometry-object.hpp
geometry-model.hpp
geometry-data.hpp
)
LIST
(
APPEND
${
PROJECT_NAME
}
_PYTHON_SOURCES
expose-geometry.cpp
algorithm/expose-geometry.cpp
)
LIST
(
APPEND HEADERS
${${
PROJECT_NAME
}
_PYTHON_HEADERS
}
)
LIST
(
REMOVE_DUPLICATES HEADERS
)
# Headers of the python binding
MAKE_DIRECTORY
(
"
${${
PROJECT_NAME
}
_BINARY_DIR
}
/include/pinocchio/bindings/python"
)
MAKE_DIRECTORY
(
"
${${
PROJECT_NAME
}
_BINARY_DIR
}
/include/pinocchio/bindings/python/algorithm"
)
SYMLINK_AND_INSTALL_HEADERS
(
"
${${
PROJECT_NAME
}
_PYTHON_HEADERS
}
"
"bindings/python"
)
# Headers of the python parser
MAKE_DIRECTORY
(
"
${${
PROJECT_NAME
}
_BINARY_DIR
}
/include/pinocchio/parsers/python"
)
SYMLINK_AND_INSTALL_HEADERS
(
"
${${
PROJECT_NAME
}
_PARSER_PYTHON_HEADERS
}
"
""
)
# --- COMPILE WRAPPER
MAKE_DIRECTORY
(
"
${${
PROJECT_NAME
}
_BINARY_DIR
}
/lib/python/
${
PROJECT_NAME
}
"
)
SET
(
${
PYWRAP
}
_SOURCES
${${
PROJECT_NAME
}
_PYTHON_SOURCES
}
${${
PROJECT_NAME
}
_PARSER_PYTHON_SOURCES
}
)
SET
(
${
PYWRAP
}
_HEADERS
${${
PROJECT_NAME
}
_PYTHON_HEADERS
}
${${
PROJECT_NAME
}
_PARSER_PYTHON_HEADERS
}
)
ADD_LIBRARY
(
${
PYWRAP
}
SHARED
${${
PYWRAP
}
_SOURCES
}
${${
PYWRAP
}
_HEADERS
}
)
ADD_HEADER_GROUP
(
${
PYWRAP
}
_PYTHON_HEADERS
)
ADD_SOURCE_GROUP
(
${
PYWRAP
}
_PYTHON_SOURCES
)
PKG_CONFIG_USE_DEPENDENCY
(
${
PYWRAP
}
eigenpy
)
TARGET_LINK_LIBRARIES
(
${
PYWRAP
}
${
PROJECT_NAME
}
)
TARGET_LINK_BOOST_PYTHON
(
${
PYWRAP
}
)
IF
(
APPLE
)
# We need to change the extension for python bindings
SET_TARGET_PROPERTIES
(
${
PYWRAP
}
PROPERTIES SUFFIX
".so"
)
ENDIF
(
APPLE
)
SET_TARGET_PROPERTIES
(
${
PYWRAP
}
PROPERTIES
LIBRARY_OUTPUT_DIRECTORY
"
${
CMAKE_BINARY_DIR
}
/lib/python/
${
PROJECT_NAME
}
"
)
INSTALL
(
FILES
"
${
CMAKE_BINARY_DIR
}
/lib/python/
${
PROJECT_NAME
}
/lib
${
PYWRAP
}
.so"
DESTINATION
${
PYTHON_SITELIB
}
/
${
PROJECT_NAME
}
)
# --- INSTALL SCRIPTS
SET
(
PYTHON_FILES
__init__.py
utils.py
robot_wrapper.py
romeo_wrapper.py
rpy.py
explog.py
)
FOREACH
(
python
${
PYTHON_FILES
}
)
GET_FILENAME_COMPONENT
(
pythonFile
${
python
}
NAME
)
EXECUTE_PROCESS
(
COMMAND
${
CMAKE_COMMAND
}
-E
${
LINK
}
${${
PROJECT_NAME
}
_SOURCE_DIR
}
/bindings/python/
${
python
}
${${
PROJECT_NAME
}
_BINARY_DIR
}
/lib/python/
${
PROJECT_NAME
}
/
${
pythonFile
}
)
# Tag pyc file as generated.
SET_SOURCE_FILES_PROPERTIES
(
"
${${
PROJECT_NAME
}
_BINARY_DIR
}
/lib/python/
${
PROJECT_NAME
}
/
${
pythonFile
}
c"
PROPERTIES GENERATED TRUE
)
EXECUTE_PROCESS
(
COMMAND
${
PYTHON_EXECUTABLE
}
-m py_compile
${${
PROJECT_NAME
}
_BINARY_DIR
}
/lib/python/
${
PROJECT_NAME
}
/
${
pythonFile
}
)
# Clean generated files.
SET_PROPERTY
(
DIRECTORY APPEND PROPERTY
ADDITIONAL_MAKE_CLEAN_FILES
"
${${
PROJECT_NAME
}
_BINARY_DIR
}
/lib/python/
${
PROJECT_NAME
}
/
${
pythonFile
}
c"
)
INSTALL
(
FILES
INSTALL
(
FILES
"
${
CMAKE_BINARY_DIR
}
/lib/python/
${
PROJECT_NAME
}
/lib
${
PYWRAP
}
.so"
"
${${
PROJECT_NAME
}
_SOURCE_DIR
}
/bindings/python/
${
python
}
"
"
${${
PROJECT_NAME
}
_BINARY_DIR
}
/lib/python/
${
PROJECT_NAME
}
/
${
pythonFile
}
c"
DESTINATION
${
PYTHON_SITELIB
}
/
${
PROJECT_NAME
}
)
DESTINATION
${
PYTHON_SITELIB
}
/
${
PROJECT_NAME
}
)
ENDFOREACH
(
python
)
# --- INSTALL SCRIPTS
SET
(
PYTHON_FILES
__init__.py
utils.py
robot_wrapper.py
romeo_wrapper.py
rpy.py
explog.py
)
FOREACH
(
python
${
PYTHON_FILES
}
)
GET_FILENAME_COMPONENT
(
pythonFile
${
python
}
NAME
)
EXECUTE_PROCESS
(
COMMAND
${
CMAKE_COMMAND
}
-E
${
LINK
}
${${
PROJECT_NAME
}
_SOURCE_DIR
}
/bindings/python/
${
python
}
${${
PROJECT_NAME
}
_BINARY_DIR
}
/lib/python/
${
PROJECT_NAME
}
/
${
pythonFile
}
)
# Tag pyc file as generated.
SET_SOURCE_FILES_PROPERTIES
(
"
${${
PROJECT_NAME
}
_BINARY_DIR
}
/lib/python/
${
PROJECT_NAME
}
/
${
pythonFile
}
c"
PROPERTIES GENERATED TRUE
)
EXECUTE_PROCESS
(
COMMAND
${
PYTHON_EXECUTABLE
}
-m py_compile
${${
PROJECT_NAME
}
_BINARY_DIR
}
/lib/python/
${
PROJECT_NAME
}
/
${
pythonFile
}
)
# Clean generated files.
SET_PROPERTY
(
DIRECTORY APPEND PROPERTY
ADDITIONAL_MAKE_CLEAN_FILES
"
${${
PROJECT_NAME
}
_BINARY_DIR
}
/lib/python/
${
PROJECT_NAME
}
/
${
pythonFile
}
c"
)
INSTALL
(
FILES
"
${${
PROJECT_NAME
}
_SOURCE_DIR
}
/bindings/python/
${
python
}
"
"
${${
PROJECT_NAME
}
_BINARY_DIR
}
/lib/python/
${
PROJECT_NAME
}
/
${
pythonFile
}
c"
DESTINATION
${
PYTHON_SITELIB
}
/
${
PROJECT_NAME
}
)
ENDFOREACH
(
python
)
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