Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Topic/move headers #2070

Merged
merged 13 commits into from
Oct 25, 2023
80 changes: 0 additions & 80 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,6 @@ IF(CMAKE_VERSION VERSION_GREATER "3.12")
CMAKE_POLICY(SET CMP0074 NEW)
ENDIF()

IF(WIN32)
SET(LINK copy_if_different)
ELSE(WIN32)
SET(LINK create_symlink)
ENDIF(WIN32)

# --- OPTIONS ----------------------------------------
OPTION(BUILD_BENCHMARK "Build the benchmarks" OFF)
OPTION(BUILD_UTILS "Build the utils" OFF)
Expand Down Expand Up @@ -210,80 +204,6 @@ ENDIF(BUILD_WITH_HPP_FCL_SUPPORT)
ADD_DEFINITIONS(-DBOOST_MPL_LIMIT_LIST_SIZE=30)
ADD_DEFINITIONS(-DBOOST_MPL_LIMIT_VECTOR_SIZE=30)

# ----------------------------------------------------
# --- INCLUDE ----------------------------------------
# ----------------------------------------------------
FILE(GLOB_RECURSE HEADERS
${PROJECT_SOURCE_DIR}/src/*.hpp
${PROJECT_SOURCE_DIR}/src/*.hxx
)

IF(NOT BUILD_WITH_URDF_SUPPORT)
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(NOT BUILD_WITH_URDF_SUPPORT)

IF(NOT BUILD_WITH_HPP_FCL_SUPPORT)
LIST(REMOVE_ITEM HEADERS
${PROJECT_SOURCE_DIR}/src/spatial/fcl-pinocchio-conversions.hpp
)
ENDIF(NOT BUILD_WITH_HPP_FCL_SUPPORT)

LIST(APPEND HEADERS macros.hpp)

MAKE_DIRECTORY("${${PROJECT_NAME}_BINARY_DIR}/include/pinocchio")
MAKE_DIRECTORY("${${PROJECT_NAME}_BINARY_DIR}/include/pinocchio/core")
MAKE_DIRECTORY("${${PROJECT_NAME}_BINARY_DIR}/include/pinocchio/math")
MAKE_DIRECTORY("${${PROJECT_NAME}_BINARY_DIR}/include/pinocchio/spatial")
MAKE_DIRECTORY("${${PROJECT_NAME}_BINARY_DIR}/include/pinocchio/multibody")
MAKE_DIRECTORY("${${PROJECT_NAME}_BINARY_DIR}/include/pinocchio/multibody/joint")
MAKE_DIRECTORY("${${PROJECT_NAME}_BINARY_DIR}/include/pinocchio/multibody/liegroup")
MAKE_DIRECTORY("${${PROJECT_NAME}_BINARY_DIR}/include/pinocchio/multibody/pool")
MAKE_DIRECTORY("${${PROJECT_NAME}_BINARY_DIR}/include/pinocchio/multibody/visitor")
MAKE_DIRECTORY("${${PROJECT_NAME}_BINARY_DIR}/include/pinocchio/parsers")
MAKE_DIRECTORY("${${PROJECT_NAME}_BINARY_DIR}/include/pinocchio/parsers/urdf")
MAKE_DIRECTORY("${${PROJECT_NAME}_BINARY_DIR}/include/pinocchio/utils")
MAKE_DIRECTORY("${${PROJECT_NAME}_BINARY_DIR}/include/pinocchio/serialization")
MAKE_DIRECTORY("${${PROJECT_NAME}_BINARY_DIR}/include/pinocchio/algorithm")
MAKE_DIRECTORY("${${PROJECT_NAME}_BINARY_DIR}/include/pinocchio/algorithm/parallel")
MAKE_DIRECTORY("${${PROJECT_NAME}_BINARY_DIR}/include/pinocchio/container")
MAKE_DIRECTORY("${${PROJECT_NAME}_BINARY_DIR}/include/pinocchio/codegen")
MAKE_DIRECTORY("${${PROJECT_NAME}_BINARY_DIR}/include/pinocchio/autodiff")
MAKE_DIRECTORY("${${PROJECT_NAME}_BINARY_DIR}/include/pinocchio/autodiff/casadi")
MAKE_DIRECTORY("${${PROJECT_NAME}_BINARY_DIR}/include/pinocchio/autodiff/casadi/math")
MAKE_DIRECTORY("${${PROJECT_NAME}_BINARY_DIR}/include/pinocchio/autodiff/casadi/spatial")
MAKE_DIRECTORY("${${PROJECT_NAME}_BINARY_DIR}/include/pinocchio/autodiff/casadi/utils")
MAKE_DIRECTORY("${${PROJECT_NAME}_BINARY_DIR}/include/pinocchio/autodiff/cppad")
MAKE_DIRECTORY("${${PROJECT_NAME}_BINARY_DIR}/include/pinocchio/autodiff/cppad/spatial")
MAKE_DIRECTORY("${${PROJECT_NAME}_BINARY_DIR}/include/pinocchio/autodiff/cppad/math")
MAKE_DIRECTORY("${${PROJECT_NAME}_BINARY_DIR}/include/pinocchio/autodiff/cppad/algorithm")
MAKE_DIRECTORY("${${PROJECT_NAME}_BINARY_DIR}/include/pinocchio/autodiff/cppad/utils")

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}
${${PROJECT_NAME}_SOURCE_DIR}/src/${header}
${${PROJECT_NAME}_BINARY_DIR}/include/${PROJECT_NAME}/${header})
INSTALL(FILES ${${PROJECT_NAME}_SOURCE_DIR}/src/${header}
DESTINATION ${CMAKE_INSTALL_PREFIX}/include/${PROJECT_NAME}/${headerPath}
PERMISSIONS OWNER_READ GROUP_READ WORLD_READ OWNER_WRITE)
ENDFOREACH(header)
SET(HEADERS ${HEADERS_})

LIST(APPEND HEADERS
${${PROJECT_NAME}_BINARY_DIR}/include/${PROJECT_NAME}/config.hpp
${${PROJECT_NAME}_BINARY_DIR}/include/${PROJECT_NAME}/deprecated.hpp
${${PROJECT_NAME}_BINARY_DIR}/include/${PROJECT_NAME}/warning.hpp)

# --- MAIN LIBRARY -------------------------------------------------------------
ADD_SUBDIRECTORY(src)

Expand Down
110 changes: 30 additions & 80 deletions bindings/python/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,62 +5,31 @@

include(${JRL_CMAKE_MODULES}/python-helpers.cmake)

# --- MACROS --- #
MACRO(SYMLINK_AND_INSTALL_HEADERS HEADERS SUBPATH)
FOREACH(header ${HEADERS})
GET_FILENAME_COMPONENT(headerName ${header} NAME)
GET_FILENAME_COMPONENT(headerPath ${header} PATH)
EXECUTE_PROCESS(COMMAND ${CMAKE_COMMAND} -E ${LINK}
${CMAKE_CURRENT_SOURCE_DIR}/${header}
${${PROJECT_NAME}_BINARY_DIR}/include/${PROJECT_NAME}/${SUBPATH}/${header})

INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${header}
DESTINATION ${CMAKE_INSTALL_PREFIX}/include/${PROJECT_NAME}/${SUBPATH}/${headerPath}
PERMISSIONS OWNER_READ GROUP_READ WORLD_READ OWNER_WRITE)
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)

FUNCTION(LIST_FILTER list regular_expression dest_list)
FOREACH(elt ${list})
IF(${elt} MATCHES ${regular_expression})
LIST(REMOVE_ITEM list ${elt})
ENDIF()
ENDFOREACH(elt ${list})
SET(${dest_list} ${list} PARENT_SCOPE)
ENDFUNCTION(LIST_FILTER)

# --- PYTHON TARGET --- #
SET(PYWRAP ${PROJECT_NAME}_pywrap)
SET(PYWRAP ${PYWRAP} PARENT_SCOPE)

FILE(GLOB_RECURSE ${PROJECT_NAME}_PYTHON_HEADERS
${CMAKE_CURRENT_SOURCE_DIR}/*.hpp
)
RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}
${PROJECT_SOURCE_DIR}/include/${PROJECT_NAME}/bindings/*.hpp
${PROJECT_SOURCE_DIR}/include/${PROJECT_NAME}/bindings/*.hxx
)

FILE(GLOB_RECURSE ${PROJECT_NAME}_PYTHON_SOURCES
${CMAKE_CURRENT_SOURCE_DIR}/*.cpp
)
RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_CURRENT_SOURCE_DIR}/*.cpp
)

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)
SET(SOURCE_HEADERS_ROOT "../../include/${PROJECT_NAME}/bindings/python")

# Parser for Python model
IF(BUILD_WITH_LIBPYTHON)
SET(${PROJECT_NAME}_PARSER_PYTHON_HEADERS
parsers/python.hpp
${SOURCE_HEADERS_ROOT}/parsers/python.hpp
)
ELSE(BUILD_WITH_LIBPYTHON)
LIST(REMOVE_ITEM ${PROJECT_NAME}_PYTHON_HEADERS
parsers/python.hpp
${SOURCE_HEADERS_ROOT}/parsers/python.hpp
)
LIST(REMOVE_ITEM ${PROJECT_NAME}_PYTHON_SOURCES
parsers/python/model.cpp
Expand All @@ -70,57 +39,29 @@ ENDIF(BUILD_WITH_LIBPYTHON)
# Python exposition of FCL
IF(NOT BUILD_WITH_HPP_FCL_PYTHON_BINDINGS)
LIST(REMOVE_ITEM ${PROJECT_NAME}_PYTHON_HEADERS
multibody/fcl/transform.hpp
${SOURCE_HEADERS_ROOT}/multibody/fcl/transform.hpp
)
LIST(REMOVE_ITEM ${PROJECT_NAME}_PYTHON_SOURCES
multibody/fcl/expose-fcl.cpp
)
ENDIF(NOT BUILD_WITH_HPP_FCL_PYTHON_BINDINGS)

IF(NOT BUILD_WITH_OPENMP_SUPPORT)
LIST_FILTER("${${PROJECT_NAME}_PYTHON_HEADERS}" "^multibody/pool" ${PROJECT_NAME}_PYTHON_HEADERS)
jorisv marked this conversation as resolved.
Show resolved Hide resolved
LIST_FILTER("${${PROJECT_NAME}_PYTHON_SOURCES}" "^multibody/pool" ${PROJECT_NAME}_PYTHON_SOURCES)
LIST_FILTER("${${PROJECT_NAME}_PYTHON_HEADERS}" "^algorithm/parallel" ${PROJECT_NAME}_PYTHON_HEADERS)
LIST_FILTER("${${PROJECT_NAME}_PYTHON_SOURCES}" "^algorithm/parallel" ${PROJECT_NAME}_PYTHON_SOURCES)
#LIST(FILTER ${PROJECT_NAME}_PYTHON_HEADERS EXCLUDE REGEX "^multibody/pool")
#LIST(FILTER ${PROJECT_NAME}_PYTHON_SOURCES EXCLUDE REGEX "^multibody/pool")
#LIST(FILTER ${PROJECT_NAME}_PYTHON_HEADERS EXCLUDE REGEX "^algorithm/parallel")
#LIST(FILTER ${PROJECT_NAME}_PYTHON_SOURCES EXCLUDE REGEX "^algorithm/parallel")
LIST(FILTER ${PROJECT_NAME}_PYTHON_HEADERS EXCLUDE REGEX "^${SOURCE_HEADERS_ROOT}/multibody/pool")
LIST(FILTER ${PROJECT_NAME}_PYTHON_SOURCES EXCLUDE REGEX "^multibody/pool")
LIST(FILTER ${PROJECT_NAME}_PYTHON_HEADERS EXCLUDE REGEX "^${SOURCE_HEADERS_ROOT}/algorithm/parallel")
LIST(FILTER ${PROJECT_NAME}_PYTHON_SOURCES EXCLUDE REGEX "^algorithm/parallel")
ELSE(NOT BUILD_WITH_OPENMP_SUPPORT)
IF(NOT BUILD_WITH_HPP_FCL_SUPPORT)
LIST_FILTER("${${PROJECT_NAME}_PYTHON_HEADERS}" "^multibody/pool/geometry.hpp" ${PROJECT_NAME}_PYTHON_HEADERS)
LIST_FILTER("${${PROJECT_NAME}_PYTHON_SOURCES}" "^algorithm/parallel/geometry.cpp" ${PROJECT_NAME}_PYTHON_SOURCES)
#LIST(FILTER ${PROJECT_NAME}_PYTHON_HEADERS EXCLUDE REGEX "^multibody/pool/geometry.hpp")
#LIST(FILTER ${PROJECT_NAME}_PYTHON_SOURCES EXCLUDE REGEX "^algorithm/parallel/geometry.cpp")
LIST(REMOVE_ITEM ${PROJECT_NAME}_PYTHON_HEADERS
${SOURCE_HEADERS_ROOT}/multibody/pool/geometry.hpp
)
LIST(REMOVE_ITEM ${PROJECT_NAME}_PYTHON_SOURCES
algorithm/parallel/geometry.cpp
)
ENDIF(NOT BUILD_WITH_HPP_FCL_SUPPORT)
ENDIF(NOT BUILD_WITH_OPENMP_SUPPORT)

LIST(APPEND HEADERS ${${PROJECT_NAME}_PYTHON_HEADERS})

# Headers of the Python bindings
MAKE_DIRECTORY("${${PROJECT_NAME}_BINARY_DIR}/include/pinocchio/bindings/python")
MAKE_DIRECTORY("${${PROJECT_NAME}_BINARY_DIR}/include/pinocchio/bindings/python/spatial")
MAKE_DIRECTORY("${${PROJECT_NAME}_BINARY_DIR}/include/pinocchio/bindings/python/multibody")
MAKE_DIRECTORY("${${PROJECT_NAME}_BINARY_DIR}/include/pinocchio/bindings/python/multibody/joint")
MAKE_DIRECTORY("${${PROJECT_NAME}_BINARY_DIR}/include/pinocchio/bindings/python/multibody/pool")
IF(BUILD_WITH_HPP_FCL_PYTHON_BINDINGS)
MAKE_DIRECTORY("${${PROJECT_NAME}_BINARY_DIR}/include/pinocchio/bindings/python/multibody/fcl")
ENDIF(BUILD_WITH_HPP_FCL_PYTHON_BINDINGS)
MAKE_DIRECTORY("${${PROJECT_NAME}_BINARY_DIR}/include/pinocchio/bindings/python/parsers")
MAKE_DIRECTORY("${${PROJECT_NAME}_BINARY_DIR}/include/pinocchio/bindings/python/serialization")
MAKE_DIRECTORY("${${PROJECT_NAME}_BINARY_DIR}/include/pinocchio/bindings/python/algorithm")
IF(BUILD_WITH_OPENMP_SUPPORT)
MAKE_DIRECTORY("${${PROJECT_NAME}_BINARY_DIR}/include/pinocchio/bindings/python/algorithm/parallel")
ENDIF(BUILD_WITH_OPENMP_SUPPORT)
MAKE_DIRECTORY("${${PROJECT_NAME}_BINARY_DIR}/include/pinocchio/bindings/python/utils")
SYMLINK_AND_INSTALL_HEADERS("${${PROJECT_NAME}_PYTHON_HEADERS}" "bindings/python")

# Headers of the Python parser
IF(BUILD_WITH_LIBPYTHON)
MAKE_DIRECTORY("${${PROJECT_NAME}_BINARY_DIR}/include/pinocchio/parsers/python")
SYMLINK_AND_INSTALL_HEADERS("${${PROJECT_NAME}_PARSER_PYTHON_HEADERS}" "")
ENDIF(BUILD_WITH_LIBPYTHON)
jorisv marked this conversation as resolved.
Show resolved Hide resolved

# --- COMPILE WRAPPER
MAKE_DIRECTORY("${${PROJECT_NAME}_BINARY_DIR}/bindings/python/${PROJECT_NAME}")
SET(${PYWRAP}_SOURCES ${${PROJECT_NAME}_PYTHON_SOURCES})
Expand Down Expand Up @@ -203,6 +144,15 @@ IF(BUILD_PYTHON_INTERFACE)
DESTINATION ${${PYWRAP}_INSTALL_DIR}
)

FOREACH(header ${${PYWRAP}_HEADERS})
GET_FILENAME_COMPONENT(header_path ${header} PATH)
STRING(REPLACE "../../" "" non_relative_header_path ${header_path})
INSTALL(FILES ${header}
DESTINATION ${CMAKE_INSTALL_PREFIX}/${non_relative_header_path}
PERMISSIONS OWNER_READ GROUP_READ WORLD_READ OWNER_WRITE)
ENDFOREACH(header)


# --- INSTALL SCRIPTS
SET(PYTHON_FILES
__init__.py
Expand Down
2 changes: 1 addition & 1 deletion bindings/python/parsers/python/model.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// Copyright (c) 2016-2023 CNRS INRIA
//

#include "pinocchio/parsers/python.hpp"
jorisv marked this conversation as resolved.
Show resolved Hide resolved
#include "pinocchio/bindings/python/parsers/python.hpp"

#include <iostream>
#include <Python.h>
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
53 changes: 50 additions & 3 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,45 @@
# Copyright (c) 2015 Wandercraft, 86 rue de Paris 91400 Orsay, France.
#

# ----------------------------------------------------
# --- INCLUDE ----------------------------------------
# ----------------------------------------------------

# Find all headers with a relative path to avoid conflict with root path
# when applying filters
FILE(GLOB_RECURSE PUBLIC_HEADERS
RELATIVE
${CMAKE_CURRENT_SOURCE_DIR}
${PROJECT_SOURCE_DIR}/include/${PROJECT_NAME}/*.hpp
${PROJECT_SOURCE_DIR}/include/${PROJECT_NAME}/*.hxx
)

SET(SOURCE_HEADERS_ROOT "../include/${PROJECT_NAME}")
SET(BINARY_HEADERS_ROOT "${${PROJECT_NAME}_BINARY_DIR}/include/${PROJECT_NAME}")

# Remove bindings
LIST(FILTER PUBLIC_HEADERS EXCLUDE REGEX "^${SOURCE_HEADERS_ROOT}/bindings/.*")

# Add generated headers
LIST(APPEND PRIVATE_HEADERS
${BINARY_HEADERS_ROOT}/config.hpp
${BINARY_HEADERS_ROOT}/deprecated.hpp
${BINARY_HEADERS_ROOT}/warning.hpp)

IF(BUILD_WITH_URDF_SUPPORT)
LIST(APPEND ${PROJECT_NAME}_SOURCES
parsers/urdf/model.cpp
parsers/urdf/geometry.cpp
parsers/urdf/utils.cpp
)
ELSE(BUILD_WITH_URDF_SUPPORT)
LIST(REMOVE_ITEM PUBLIC_HEADERS
${SOURCE_HEADERS_ROOT}/parsers/urdf.hpp
${SOURCE_HEADERS_ROOT}/parsers/urdf/model.hxx
${SOURCE_HEADERS_ROOT}/parsers/urdf/geometry.hxx
${SOURCE_HEADERS_ROOT}/parsers/urdf/utils.hpp
${SOURCE_HEADERS_ROOT}/parsers/urdf/types.hpp
)
ENDIF()

LIST(APPEND ${PROJECT_NAME}_SOURCES utils/file-explorer.cpp)
Expand All @@ -17,10 +50,11 @@ LIST(APPEND ${PROJECT_NAME}_SOURCES utils/file-explorer.cpp)
GET_DIRECTORY_PROPERTY(CURRENT_COMPILE_DEFINITIONS COMPILE_DEFINITIONS)

# Create target libpinocchio.so
ADD_LIBRARY(${PROJECT_NAME} SHARED ${HEADERS} ${${PROJECT_NAME}_SOURCES})
ADD_LIBRARY(${PROJECT_NAME} SHARED ${PUBLIC_HEADERS} ${PRIVATE_HEADERS} ${${PROJECT_NAME}_SOURCES})
SET_TARGET_PROPERTIES(${PROJECT_NAME} PROPERTIES
LINKER_LANGUAGE CXX
INSTALL_RPATH "\$ORIGIN")
INSTALL_RPATH "\$ORIGIN"
)
TARGET_COMPILE_DEFINITIONS(${PROJECT_NAME} PUBLIC ${CURRENT_COMPILE_DEFINITIONS})

# Create header-only target
Expand All @@ -29,6 +63,10 @@ ADD_LIBRARY(${PROJECT_NAME}_headers INTERFACE)
# Exclude parts from hppfcl which is not header only
IF(BUILD_WITH_HPP_FCL_SUPPORT)
LIST(REMOVE_ITEM CURRENT_COMPILE_DEFINITIONS PINOCCHIO_WITH_HPP_FCL)
ELSE(BUILD_WITH_HPP_FCL_SUPPORT)
LIST(REMOVE_ITEM PUBLIC_HEADERS
${SOURCE_HEADERS_ROOT}/spatial/fcl-pinocchio-conversions.hpp
)
ENDIF(BUILD_WITH_HPP_FCL_SUPPORT)

TARGET_COMPILE_DEFINITIONS(${PROJECT_NAME}_headers INTERFACE ${CURRENT_COMPILE_DEFINITIONS})
Expand Down Expand Up @@ -88,7 +126,8 @@ IF(hpp-fcl_FOUND)
TARGET_LINK_LIBRARIES(${PROJECT_NAME} PUBLIC hpp-fcl::hpp-fcl)
ENDIF(hpp-fcl_FOUND)

ADD_HEADER_GROUP(HEADERS)
ADD_HEADER_GROUP(PUBLIC_HEADERS)
ADD_HEADER_GROUP(PRIVATE_HEADERS)
ADD_SOURCE_GROUP(${PROJECT_NAME}_SOURCES)

INSTALL(TARGETS ${PROJECT_NAME}
Expand All @@ -102,3 +141,11 @@ INSTALL(TARGETS ${PROJECT_NAME}_headers
LIBRARY DESTINATION ${CMAKE_INSTALL_FULL_LIBDIR}
ARCHIVE DESTINATION ${CMAKE_INSTALL_FULL_LIBDIR}
RUNTIME DESTINATION ${CMAKE_INSTALL_FULL_BINDIR})

FOREACH(header ${PUBLIC_HEADERS})
GET_FILENAME_COMPONENT(header_path ${header} PATH)
STRING(REPLACE "../" "" non_relative_header_path ${header_path})
INSTALL(FILES ${header}
DESTINATION ${CMAKE_INSTALL_PREFIX}/${non_relative_header_path}
PERMISSIONS OWNER_READ GROUP_READ WORLD_READ OWNER_WRITE)
ENDFOREACH(header)
2 changes: 1 addition & 1 deletion unittest/python_parser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

#include "pinocchio/multibody/model.hpp"
#include "pinocchio/multibody/data.hpp"
#include "pinocchio/parsers/python.hpp"
jorisv marked this conversation as resolved.
Show resolved Hide resolved
#include "pinocchio/bindings/python/parsers/python.hpp"

#include <boost/test/unit_test.hpp>

Expand Down