Unverified Commit 43cc5b6a authored by Justin Carpentier's avatar Justin Carpentier Committed by GitHub
Browse files

Merge pull request #583 from jcarpent/devel

Clean cmake files
parents 68f9c24b 59bef223
#
# Copyright (c) 2015-2018 CNRS
# Copyright (c) 2015-2018 CNRS INRIA
# Copyright (c) 2015 Wandercraft, 86 rue de Paris 91400 Orsay, France.
#
# This file is part of Pinocchio
......@@ -165,221 +165,50 @@ INCLUDE_DIRECTORIES(SYSTEM ${Boost_INCLUDE_DIRS})
# ----------------------------------------------------
# --- INCLUDE ----------------------------------------
# ----------------------------------------------------
SET(${PROJECT_NAME}_MATH_HEADERS
math/fwd.hpp
math/sincos.hpp
math/quaternion.hpp
math/matrix.hpp
math/cppad.hpp
math/cppadcg.hpp
)
SET(${PROJECT_NAME}_UTILS_HEADERS
utils/axis-label.hpp
utils/eigen-fix.hpp
utils/timer.hpp
utils/string-generator.hpp
utils/file-explorer.hpp
utils/version.hpp
)
SET(${PROJECT_NAME}_CODEGEN_HEADERS
codegen/code-generator-base.hpp
codegen/code-generator-algo.hpp
)
SET(${PROJECT_NAME}_SPATIAL_HEADERS
spatial/symmetric3.hpp
spatial/se3.hpp
spatial/se3-base.hpp
spatial/se3-tpl.hpp
spatial/motion.hpp
spatial/motion-base.hpp
spatial/motion-dense.hpp
spatial/motion-tpl.hpp
spatial/motion-ref.hpp
spatial/motion-zero.hpp
spatial/force.hpp
spatial/force-base.hpp
spatial/force-dense.hpp
spatial/force-tpl.hpp
spatial/force-ref.hpp
spatial/inertia.hpp
spatial/fwd.hpp
spatial/skew.hpp
spatial/act-on-set.hpp
spatial/act-on-set.hxx
spatial/explog.hpp
spatial/explog-quaternion.hpp
spatial/cartesian-axis.hpp
spatial/spatial-axis.hpp
)
SET(${PROJECT_NAME}_MULTIBODY_JOINT_HEADERS
multibody/joint/fwd.hpp
multibody/joint/joint-base.hpp
multibody/joint/joint-collection.hpp
multibody/joint/joint-revolute.hpp
multibody/joint/joint-revolute-unaligned.hpp
multibody/joint/joint-revolute-unbounded.hpp
multibody/joint/joint-spherical.hpp
multibody/joint/joint-spherical-ZYX.hpp
multibody/joint/joint-prismatic.hpp
multibody/joint/joint-prismatic-unaligned.hpp
multibody/joint/joint-planar.hpp
multibody/joint/joint-translation.hpp
multibody/joint/joint-free-flyer.hpp
multibody/joint/joint-generic.hpp
multibody/joint/joint-basic-visitors.hpp
multibody/joint/joint-basic-visitors.hxx
multibody/joint/joint-composite.hpp
multibody/joint/joint-composite.hxx
)
SET(${PROJECT_NAME}_MULTIBODY_LIEGROUP_HEADERS
multibody/liegroup/fwd.hpp
multibody/liegroup/liegroup.hpp
multibody/liegroup/liegroup-algo.hpp
multibody/liegroup/liegroup-algo.hxx
multibody/liegroup/liegroup-collection.hpp
multibody/liegroup/liegroup-generic.hpp
multibody/liegroup/liegroup-variant.hpp
multibody/liegroup/liegroup-variant-visitors.hpp
multibody/liegroup/liegroup-variant-visitors.hxx
multibody/liegroup/liegroup-base.hpp
multibody/liegroup/liegroup-base.hxx
multibody/liegroup/vector-space.hpp
multibody/liegroup/cartesian-product.hpp
multibody/liegroup/special-orthogonal.hpp
multibody/liegroup/special-euclidean.hpp
)
SET(${PROJECT_NAME}_MULTIBODY_HEADERS
multibody/fwd.hpp
multibody/constraint.hpp
multibody/force-set.hpp
multibody/frame.hpp
multibody/model.hpp
multibody/model.hxx
multibody/data.hpp
multibody/data.hxx
multibody/visitor.hpp
)
SET(${PROJECT_NAME}_ALGORITHM_HEADERS
algorithm/aba.hpp
algorithm/aba.hxx
algorithm/aba-derivatives.hpp
algorithm/aba-derivatives.hxx
algorithm/centroidal.hpp
algorithm/centroidal.hxx
algorithm/centroidal-derivatives.hpp
algorithm/centroidal-derivatives.hxx
algorithm/rnea.hpp
algorithm/rnea.hxx
algorithm/rnea-derivatives.hpp
algorithm/rnea-derivatives.hxx
algorithm/crba.hpp
algorithm/crba.hxx
algorithm/finite-differences.hpp
algorithm/finite-differences.hxx
algorithm/jacobian.hpp
algorithm/jacobian.hxx
algorithm/cholesky.hpp
algorithm/cholesky.hxx
algorithm/kinematics.hpp
algorithm/kinematics.hxx
algorithm/kinematics-derivatives.hpp
algorithm/kinematics-derivatives.hxx
algorithm/dynamics.hpp
algorithm/center-of-mass.hpp
algorithm/center-of-mass.hxx
algorithm/joint-configuration.hpp
algorithm/joint-configuration.hxx
algorithm/energy.hpp
algorithm/frames.hpp
algorithm/frames.hxx
algorithm/compute-all-terms.hpp
algorithm/copy.hpp
algorithm/check.hpp
algorithm/check.hxx
algorithm/default-check.hpp
algorithm/regressor.hpp
algorithm/regressor.hxx
)
SET(${PROJECT_NAME}_CONTAINER_HEADERS
container/aligned-vector.hpp
)
SET(${PROJECT_NAME}_PARSERS_HEADERS
parsers/sample-models.hpp
parsers/utils.hpp
parsers/srdf.hpp
parsers/srdf.hxx
)
FILE(GLOB_RECURSE HEADERS
${PROJECT_SOURCE_DIR}/src/*.hpp
${PROJECT_SOURCE_DIR}/src/*.hxx
)
IF(URDFDOM_FOUND)
LIST(APPEND ${PROJECT_NAME}_PARSERS_HEADERS
parsers/urdf.hpp
parsers/urdf/model.hxx
parsers/urdf/geometry.hxx
parsers/urdf/utils.hpp
parsers/urdf/types.hpp
)
ADD_DEFINITIONS(-DWITH_URDFDOM)
LIST(APPEND CFLAGS_DEPENDENCIES "-DWITH_URDFDOM")
ELSE(URDFDOM_FOUND)
LIST(REMOVE_ITEM HEADERS
${PROJECT_SOURCE_DIR}/src/parsers/urdf.hpp
${PROJECT_SOURCE_DIR}/src/parsers/urdf/model.hxx
${PROJECT_SOURCE_DIR}/src/parsers/urdf/geometry.hxx
${PROJECT_SOURCE_DIR}/src/parsers/urdf/utils.hpp
${PROJECT_SOURCE_DIR}/src/parsers/urdf/types.hpp
)
ENDIF(URDFDOM_FOUND)
LIST(APPEND ${PROJECT_NAME}_MULTIBODY_HEADERS
multibody/fcl.hpp
multibody/fcl.hxx
multibody/geometry.hpp
multibody/geometry.hxx
)
LIST(APPEND ${PROJECT_NAME}_ALGORITHM_HEADERS
algorithm/geometry.hpp
algorithm/geometry.hxx
)
IF(HPP_FCL_FOUND)
LIST(APPEND ${PROJECT_NAME}_SPATIAL_HEADERS
spatial/fcl-pinocchio-conversions.hpp
)
IF(HPP_FCL_FOUND)
ADD_DEFINITIONS(-DWITH_HPP_FCL)
LIST(APPEND CFLAGS_DEPENDENCIES "-DWITH_HPP_FCL")
ELSE(HPP_FCL_FOUND)
LIST(REMOVE_ITEM HEADERS
${PROJECT_SOURCE_DIR}/src/spatial/fcl-pinocchio-conversions.hpp
)
ENDIF(HPP_FCL_FOUND)
IF(LUA5_FOUND)
LIST(APPEND ${PROJECT_NAME}_PARSERS_HEADERS
parsers/lua.hpp
parsers/lua/lua_tables.hpp
)
ADD_DEFINITIONS(-DWITH_LUA5)
LIST(APPEND CFLAGS_DEPENDENCIES "-DWITH_LUA5")
ELSE(LUA5_FOUND)
LIST(REMOVE_ITEM HEADERS
${PROJECT_SOURCE_DIR}/src/parsers/lua.hpp
${PROJECT_SOURCE_DIR}/src/parsers/lua/lua_tables.hpp
)
ENDIF(LUA5_FOUND)
SET(HEADERS
${${PROJECT_NAME}_MATH_HEADERS}
${${PROJECT_NAME}_UTILS_HEADERS}
${${PROJECT_NAME}_SPATIAL_HEADERS}
${${PROJECT_NAME}_MULTIBODY_JOINT_HEADERS}
${${PROJECT_NAME}_MULTIBODY_LIEGROUP_HEADERS}
${${PROJECT_NAME}_MULTIBODY_HEADERS}
${${PROJECT_NAME}_PARSERS_HEADERS}
${${PROJECT_NAME}_ALGORITHM_HEADERS}
${${PROJECT_NAME}_CONTAINER_HEADERS}
${${PROJECT_NAME}_CODEGEN_HEADERS}
exception.hpp
assert.hpp
macros.hpp
eigen-macros.hpp
fwd.hpp
)
LIST(REMOVE_DUPLICATES HEADERS)
LIST(APPEND HEADERS
exception.hpp
assert.hpp
macros.hpp
)
MAKE_DIRECTORY("${${PROJECT_NAME}_BINARY_DIR}/include/pinocchio")
MAKE_DIRECTORY("${${PROJECT_NAME}_BINARY_DIR}/include/pinocchio/math")
......@@ -394,8 +223,10 @@ MAKE_DIRECTORY("${${PROJECT_NAME}_BINARY_DIR}/include/pinocchio/utils")
MAKE_DIRECTORY("${${PROJECT_NAME}_BINARY_DIR}/include/pinocchio/algorithm")
MAKE_DIRECTORY("${${PROJECT_NAME}_BINARY_DIR}/include/pinocchio/container")
MAKE_DIRECTORY("${${PROJECT_NAME}_BINARY_DIR}/include/pinocchio/codegen")
SET(HEADERS_)
FOREACH(header ${HEADERS})
STRING(REGEX REPLACE "${PROJECT_SOURCE_DIR}/src/" "" header ${header})
LIST(APPEND HEADERS_ ${header})
GET_FILENAME_COMPONENT(headerName ${header} NAME)
GET_FILENAME_COMPONENT(headerPath ${header} PATH)
EXECUTE_PROCESS(COMMAND ${CMAKE_COMMAND} -E ${LINK}
......@@ -405,12 +236,12 @@ FOREACH(header ${HEADERS})
DESTINATION ${CMAKE_INSTALL_PREFIX}/include/${PROJECT_NAME}/${headerPath}
PERMISSIONS OWNER_READ GROUP_READ WORLD_READ OWNER_WRITE)
ENDFOREACH(header)
SET(HEADERS ${HEADERS_})
# --- MAIN LIBRARY -------------------------------------------------------------
ADD_SUBDIRECTORY(src)
# --- BINDINGS -----------------------------------------------------------------
SET(PYWRAP ${PROJECT_NAME}_pywrap)
ADD_SUBDIRECTORY(bindings)
# --- EXECUTABLES --------------------------------------------------------------
......
#
# Copyright (c) 2016 CNRS
# Copyright (c) 2016-2018 CNRS INRIA
#
# This file is part of Pinocchio
# pinocchio is free software: you can redistribute it
......@@ -16,4 +16,5 @@
IF(BUILD_PYTHON_INTERFACE)
ADD_SUBDIRECTORY(python)
SET(PYWRAP ${PYWRAP} PARENT_SCOPE)
ENDIF(BUILD_PYTHON_INTERFACE)
#
# Copyright (c) 2015-2018 CNRS
# Copyright (c) 2015-2018 CNRS INRIA
# Copyright (c) 2015 Wandercraft, 86 rue de Paris 91400 Orsay, France.
#
# This file is part of Pinocchio
......@@ -30,10 +30,23 @@ MACRO(SYMLINK_AND_INSTALL_HEADERS HEADERS SUBPATH)
ENDFOREACH(header)
ENDMACRO(SYMLINK_AND_INSTALL_HEADERS HEADERS SUBPATH)
FUNCTION(REMOVE_PATH_FROM_LIST list_name path_name dest_list)
SET(list_name_)
FOREACH(header ${list_name})
STRING(REGEX REPLACE "${path_name}" "" header ${header})
LIST(APPEND list_name_ ${header})
ENDFOREACH(header ${list_name_})
SET(${dest_list} ${list_name_} PARENT_SCOPE)
ENDFUNCTION(REMOVE_PATH_FROM_LIST)
# --- PYTHON TARGET --- #
ADD_CUSTOM_TARGET(python)
SET_TARGET_PROPERTIES(python PROPERTIES EXCLUDE_FROM_DEFAULT_BUILD True)
SET(PYWRAP ${PROJECT_NAME}_pywrap)
SET(PYWRAP ${PYWRAP} PARENT_SCOPE)
# --- DEPENDENCIES --- #
SET(PKG_CONFIG_PYWRAP_REQUIRES "eigenpy >= 1.4.0")
FOREACH(dep ${PKG_CONFIG_PYWRAP_REQUIRES})
......@@ -43,98 +56,43 @@ ENDFOREACH(dep ${PKG_CONFIG_PYWRAP_REQUIRES})
# --- LIBRARY --- #
SET(${PYWRAP}_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}/${PYTHON_SITELIB}/${PROJECT_NAME})
SET(${PROJECT_NAME}_PYTHON_HEADERS
utils/constant.hpp
utils/eigen_container.hpp
utils/handler.hpp
utils/copyable.hpp
utils/printable.hpp
utils/std-vector.hpp
utils/std-aligned-vector.hpp
utils/version.hpp
fwd.hpp
spatial/se3.hpp
spatial/force.hpp
spatial/motion.hpp
spatial/inertia.hpp
spatial/explog.hpp
multibody/frame.hpp
multibody/model.hpp
multibody/data.hpp
multibody/geometry-object.hpp
multibody/geometry-model.hpp
multibody/geometry-data.hpp
multibody/joint/joints-models.hpp
multibody/joint/joints-variant.hpp
multibody/joint/joint.hpp
multibody/joint/joint-derived.hpp
algorithm/algorithms.hpp
parsers/parsers.hpp
parsers/sample-models.hpp
)
FILE(GLOB_RECURSE ${PROJECT_NAME}_PYTHON_HEADERS
${CMAKE_CURRENT_SOURCE_DIR}/*.hpp
)
SET(${PROJECT_NAME}_PYTHON_SOURCES
module.cpp
utils/version.cpp
spatial/expose-SE3.cpp
spatial/expose-motion.cpp
spatial/expose-force.cpp
spatial/expose-inertia.cpp
spatial/expose-explog.cpp
multibody/expose-frame.cpp
multibody/expose-model.cpp
multibody/expose-data.cpp
multibody/expose-geometry.cpp
multibody/joint/expose-joints.cpp
algorithm/expose-algorithms.cpp
algorithm/expose-com.cpp
algorithm/expose-kinematics.cpp
algorithm/expose-dynamics.cpp
algorithm/expose-crba.cpp
algorithm/expose-centroidal.cpp
algorithm/expose-rnea.cpp
algorithm/expose-rnea-derivatives.cpp
algorithm/expose-aba.cpp
algorithm/expose-aba-derivatives.cpp
algorithm/expose-jacobian.cpp
algorithm/expose-kinematics-derivatives.cpp
algorithm/expose-joints.cpp
algorithm/expose-energy.cpp
algorithm/expose-frames.cpp
algorithm/expose-cat.cpp
algorithm/expose-geometry.cpp
algorithm/expose-regressor.cpp
parsers/expose-parsers.cpp
)
FILE(GLOB_RECURSE ${PROJECT_NAME}_PYTHON_SOURCES
${CMAKE_CURRENT_SOURCE_DIR}/*.cpp
)
# Parser for Python model
LIST(APPEND ${PROJECT_NAME}_PYTHON_HEADERS
parsers/python.hpp
)
SET(${PROJECT_NAME}_PARSER_PYTHON_HEADERS
parsers/python.hpp
)
SET(${PROJECT_NAME}_PARSER_PYTHON_SOURCES
LIST(APPEND ${PROJECT_NAME}_PYTHON_SOURCES
parsers/python/model.cpp
)
# Python exposition of FCL
IF(HPP_FCL_FOUND)
SET(${PROJECT_NAME}_PYTHON_FCL_HEADERS
IF(NOT HPP_FCL_FOUND)
LIST(REMOVE_ITEM ${PROJECT_NAME}_PYTHON_HEADERS
multibody/fcl/contact.hpp
multibody/fcl/collision-result.hpp
multibody/fcl/distance-result.hpp
multibody/fcl/collision-geometry.hpp
)
SET(${PROJECT_NAME}_PYTHON_FCL_SOURCES
LIST(REMOVE_ITEM ${PROJECT_NAME}_PYTHON_SOURCES
multibody/fcl/expose-fcl.cpp
)
ENDIF(NOT HPP_FCL_FOUND)
LIST(APPEND ${PROJECT_NAME}_PYTHON_HEADERS ${${PROJECT_NAME}_PYTHON_FCL_HEADERS})
LIST(APPEND ${PROJECT_NAME}_PYTHON_SOURCES ${${PROJECT_NAME}_PYTHON_FCL_SOURCES})
ENDIF(HPP_FCL_FOUND)
REMOVE_PATH_FROM_LIST("${${PROJECT_NAME}_PYTHON_HEADERS}" "${CMAKE_CURRENT_SOURCE_DIR}/" ${PROJECT_NAME}_PYTHON_HEADERS)
REMOVE_PATH_FROM_LIST("${${PROJECT_NAME}_PYTHON_SOURCES}" "${CMAKE_CURRENT_SOURCE_DIR}/" ${PROJECT_NAME}_PYTHON_SOURCES)
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")
......@@ -155,8 +113,8 @@ SYMLINK_AND_INSTALL_HEADERS("${${PROJECT_NAME}_PARSER_PYTHON_HEADERS}" "")
# --- COMPILE WRAPPER
MAKE_DIRECTORY("${${PROJECT_NAME}_BINARY_DIR}/bindings/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})
SET(${PYWRAP}_SOURCES ${${PROJECT_NAME}_PYTHON_SOURCES})
SET(${PYWRAP}_HEADERS ${${PROJECT_NAME}_PYTHON_HEADERS})
ADD_LIBRARY(${PYWRAP} SHARED ${${PYWRAP}_SOURCES} ${${PYWRAP}_HEADERS})
ADD_DEPENDENCIES(python ${PYWRAP})
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment