Skip to content

Commit

Permalink
cmake: Rename private headers into generated headers
Browse files Browse the repository at this point in the history
  • Loading branch information
Joris Vaillant committed Oct 24, 2023
1 parent 82b436a commit d162118
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 7 deletions.
12 changes: 8 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -201,11 +201,13 @@ ENDIF(BUILD_WITH_HPP_FCL_SUPPORT)
# Sources definition
INCLUDE(sources.cmake)

# URDF sources
IF(BUILD_WITH_URDF_SUPPORT)
LIST(APPEND ${PROJECT_NAME}_CORE_SOURCES ${${PROJECT_NAME}_URDF_SOURCES})
LIST(APPEND ${PROJECT_NAME}_CORE_PUBLIC_HEADERS ${${PROJECT_NAME}_URDF_PUBLIC_HEADERS})
ENDIF(BUILD_WITH_URDF_SUPPORT)

# LibPython sources
IF(BUILD_WITH_LIBPYTHON)
LIST(APPEND ${PROJECT_NAME}_CORE_PUBLIC_HEADERS
${${PROJECT_NAME}_LIBPYTHON_PUBLIC_HEADERS})
Expand All @@ -215,6 +217,7 @@ IF(BUILD_WITH_LIBPYTHON)
${${PROJECT_NAME}_BINDINGS_PYTHON_LIBPYTHON_PUBLIC_HEADERS})
ENDIF(BUILD_WITH_LIBPYTHON)

# HPP-FCL sources
IF(BUILD_WITH_HPP_FCL_SUPPORT)
LIST(APPEND ${PROJECT_NAME}_CORE_PUBLIC_HEADERS
${${PROJECT_NAME}_HPP_FCL_PUBLIC_HEADERS})
Expand All @@ -224,16 +227,17 @@ IF(BUILD_WITH_HPP_FCL_SUPPORT)
${${PROJECT_NAME}_BINDINGS_PYTHON_HPP_FCL_PUBLIC_HEADERS})
ENDIF(BUILD_WITH_HPP_FCL_SUPPORT)

# OpenMP and HPP-FCL+OpenMP sources
IF(BUILD_WITH_OPENMP_SUPPORT)
LIST(APPEND ${PROJECT_NAME}_BINDINGS_PYTHON_SOURCES
${${PROJECT_NAME}_BINDINGS_PYTHON_OPENMP_SOURCES})
LIST(APPEND ${PROJECT_NAME}_BINDINGS_PYTHON_PUBLIC_HEADERS
${${PROJECT_NAME}_BINDINGS_PYTHON_OPENMP_PUBLIC_HEADERS})
IF(BUILD_WITH_HPP_FCL_SUPPORT)
LIST(APPEND ${PROJECT_NAME}_BINDINGS_PYTHON_SOURCES
${${PROJECT_NAME}_BINDINGS_PYTHON_HPP_FCL_OPENMP_SOURCES})
LIST(APPEND ${PROJECT_NAME}_BINDINGS_PYTHON_PUBLIC_HEADERS
${${PROJECT_NAME}_BINDINGS_PYTHON_HPP_FCL_OPENMP_PUBLIC_HEADERS})
LIST(APPEND ${PROJECT_NAME}_BINDINGS_PYTHON_SOURCES
${${PROJECT_NAME}_BINDINGS_PYTHON_HPP_FCL_OPENMP_SOURCES})
LIST(APPEND ${PROJECT_NAME}_BINDINGS_PYTHON_PUBLIC_HEADERS
${${PROJECT_NAME}_BINDINGS_PYTHON_HPP_FCL_OPENMP_PUBLIC_HEADERS})
ENDIF(BUILD_WITH_HPP_FCL_SUPPORT)
ENDIF()

Expand Down
2 changes: 1 addition & 1 deletion sources.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ SET(${PROJECT_NAME}_HPP_FCL_PUBLIC_HEADERS
)

SET(_binary_headers_root ${${PROJECT_NAME}_BINARY_DIR}/include/pinocchio)
SET(${PROJECT_NAME}_CORE_PRIVATE_HEADERS
SET(${PROJECT_NAME}_CORE_GENERATED_PUBLIC_HEADERS
${_binary_headers_root}/config.hpp
${_binary_headers_root}/deprecated.hpp
${_binary_headers_root}/warning.hpp
Expand Down
4 changes: 2 additions & 2 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ PREPEND_PATH_FROM_LIST(${PROJECT_NAME}_CORE_PUBLIC_HEADERS
ADD_LIBRARY(${PROJECT_NAME} SHARED
${${PROJECT_NAME}_CORE_SOURCES}
${${PROJECT_NAME}_CORE_PUBLIC_HEADERS}
${${PROJECT_NAME}_CORE_PRIVATE_HEADERS})
${${PROJECT_NAME}_CORE_GENERATED_PUBLIC_HEADERS})
SET_TARGET_PROPERTIES(${PROJECT_NAME} PROPERTIES
LINKER_LANGUAGE CXX
INSTALL_RPATH "\$ORIGIN"
Expand Down Expand Up @@ -93,7 +93,7 @@ ENDIF(hpp-fcl_FOUND)

ADD_SOURCE_GROUP(${PROJECT_NAME}_CORE_SOURCES)
ADD_HEADER_GROUP(${PROJECT_NAME}_CORE_PUBLIC_HEADERS)
ADD_HEADER_GROUP(${PROJECT_NAME}_CORE_PRIVATE_HEADERS)
ADD_HEADER_GROUP(${PROJECT_NAME}_CORE_GENERATED_PUBLIC_HEADERS)

INSTALL(TARGETS ${PROJECT_NAME}
EXPORT ${TARGETS_EXPORT_NAME}
Expand Down

0 comments on commit d162118

Please sign in to comment.