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

Generate namespace headers without requiring *.hpp.in files #1192

Merged
merged 3 commits into from
Nov 11, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@

* Build system

* Fix compilation warnings for newer versions of compilers: [#1177](https://github.com/dartsim/dart/pull/1177)
* Fixed compilation warnings for newer versions of compilers: [#1177](https://github.com/dartsim/dart/pull/1177)
* Changed to generate namespace headers without requiring *.hpp.in files: [#1192](https://github.com/dartsim/dart/pull/1192)

* Collision Detection

Expand Down Expand Up @@ -299,7 +300,7 @@

* Common data structures

* Added `Node`, `Aspect`, `State`, and `Properties`: [#713](https://github.com/dartsim/dart/pull/713), [#712](https://github.com/dartsim/dart/issues/712), [#708](https://github.com/dartsim/dart/pull/708), [#707](https://github.com/dartsim/dart/pull/707), [#659](https://github.com/dartsim/dart/pull/659), [#649](https://github.com/dartsim/dart/pull/649), [#645](https://github.com/dartsim/dart/issues/645), [#607](https://github.com/dartsim/dart/pull/607), [#598](https://github.com/dartsim/dart/pull/598), [#591](https://github.com/dartsim/dart/pull/591), [#531](https://github.com/dartsim/dart/pull/531)
* Added `Node`, `Aspect`, `State`, and `Properties`: [#713](https://github.com/dartsim/dart/pull/713), [#712](https://github.com/dartsim/dart/issues/712), [#708](https://github.com/dartsim/dart/pull/708), [#707](https://github.com/dartsim/dart/pull/707), [#659](https://github.com/dartsim/dart/pull/659), [#649](https://github.com/dartsim/dart/pull/649), [#645](https://github.com/dartsim/dart/issues/645), [#607](https://github.com/dartsim/dart/pull/607), [#598](https://github.com/dartsim/dart/pull/598), [#591](https://github.com/dartsim/dart/pull/591), [#531](https://github.com/dartsim/dart/pull/531)
* Added mathematical constants and user-defined literals for radian, degree, and pi: [#669](https://github.com/dartsim/dart/pull/669), [#314](https://github.com/dartsim/dart/issues/314)
* Added `ShapeFrame` and `ShapeNode`: [#608](https://github.com/dartsim/dart/pull/608)
* Added `BoundingBox`: [#547](https://github.com/dartsim/dart/pull/547), [#546](https://github.com/dartsim/dart/issues/546)
Expand Down Expand Up @@ -402,7 +403,7 @@

### Version 5.1.6 (2017-08-08)

1. Improved camera movement of OpenGL GUI: smooth zooming and translation
1. Improved camera movement of OpenGL GUI: smooth zooming and translation
* [Pull request #843](https://github.com/dartsim/dart/pull/843)

2. Removed debian meta files from the main DART repository
Expand Down
14 changes: 14 additions & 0 deletions cmake/DARTMacros.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ macro(dart_get_subdir_list var curdir)
endmacro()

#===============================================================================
# DEPRECATED in 6.7 (see #1081)
#
# Generate header file list to a cached list.
# Usage:
# dart_generate_include_header_list(_var _target_dir _cacheDesc [headers...])
Expand All @@ -58,6 +60,18 @@ macro(dart_generate_include_header_list _var _target_dir _cacheDesc)
endforeach()
endmacro()

#===============================================================================
# Generate header file.
# Usage:
# dart_generate_include_header_file(file_path target_dir [headers...])
#===============================================================================
macro(dart_generate_include_header_file file_path target_dir)
file(WRITE ${file_path} "// Automatically generated file by cmake\n\n")
foreach(header ${ARGN})
file(APPEND ${file_path} "#include \"${target_dir}${header}\"\n")
endforeach()
endmacro()

#===============================================================================
# Add library and set target properties
# Usage:
Expand Down
9 changes: 2 additions & 7 deletions dart/collision/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,11 @@ set(
dart/dart.hpp
fcl/fcl.hpp
)
dart_generate_include_header_list(
collision_headers
dart_generate_include_header_file(
"${CMAKE_CURRENT_BINARY_DIR}/collision.hpp"
"dart/collision/"
"collision headers"
${header_names}
)
configure_file(
${CMAKE_CURRENT_SOURCE_DIR}/collision.hpp.in
${CMAKE_CURRENT_BINARY_DIR}/collision.hpp
)

# Install
install(
Expand Down
9 changes: 2 additions & 7 deletions dart/collision/bullet/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -71,16 +71,11 @@ add_component_dependencies(${PROJECT_NAME} ${component_name} dart)

# Generate header for this namespace
dart_get_filename_components(header_names "collision_bullet headers" ${hdrs})
dart_generate_include_header_list(
collision_bullet_headers
dart_generate_include_header_file(
"${CMAKE_CURRENT_BINARY_DIR}/bullet.hpp"
"dart/collision/bullet/"
"collision_bullet headers"
${header_names}
)
configure_file(
${CMAKE_CURRENT_SOURCE_DIR}/bullet.hpp.in
${CMAKE_CURRENT_BINARY_DIR}/bullet.hpp
)

# Install
install(
Expand Down
3 changes: 0 additions & 3 deletions dart/collision/collision.hpp.in

This file was deleted.

9 changes: 2 additions & 7 deletions dart/collision/dart/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,11 @@ dart_add_core_sources(${srcs} ${detail_srcs})

# Generate header for this namespace
dart_get_filename_components(header_names "collision_dart headers" ${hdrs})
dart_generate_include_header_list(
collision_dart_headers
dart_generate_include_header_file(
"${CMAKE_CURRENT_BINARY_DIR}/dart.hpp"
"dart/collision/dart/"
"collision_dart headers"
${header_names}
)
configure_file(
${CMAKE_CURRENT_SOURCE_DIR}/dart.hpp.in
${CMAKE_CURRENT_BINARY_DIR}/dart.hpp
)

# Install
install(
Expand Down
9 changes: 2 additions & 7 deletions dart/collision/fcl/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,11 @@ dart_add_core_sources(${srcs} ${detail_srcs})

# Generate header for this namespace
dart_get_filename_components(header_names "collision_fcl headers" ${hdrs})
dart_generate_include_header_list(
collision_fcl_headers
dart_generate_include_header_file(
"${CMAKE_CURRENT_BINARY_DIR}/fcl.hpp"
"dart/collision/fcl/"
"collision_fcl headers"
${header_names}
)
configure_file(
${CMAKE_CURRENT_SOURCE_DIR}/fcl.hpp.in
${CMAKE_CURRENT_BINARY_DIR}/fcl.hpp
)

# Install
install(
Expand Down
9 changes: 2 additions & 7 deletions dart/collision/ode/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,16 +31,11 @@ add_component_dependencies(${PROJECT_NAME} ${component_name} dart)

# Generate header for this namespace
dart_get_filename_components(header_names "collision_ode headers" ${hdrs})
dart_generate_include_header_list(
collision_ode_headers
dart_generate_include_header_file(
"${CMAKE_CURRENT_BINARY_DIR}/ode.hpp"
"dart/collision/ode/"
"collision_ode headers"
${header_names}
)
configure_file(
${CMAKE_CURRENT_SOURCE_DIR}/ode.hpp.in
${CMAKE_CURRENT_BINARY_DIR}/ode.hpp
)

# Install
install(
Expand Down
9 changes: 2 additions & 7 deletions dart/common/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,11 @@ dart_add_core_sources(${srcs} ${detail_srcs})

# Generate header for this namespace
dart_get_filename_components(header_names "common headers" ${hdrs})
dart_generate_include_header_list(
common_headers
dart_generate_include_header_file(
"${CMAKE_CURRENT_BINARY_DIR}/common.hpp"
"dart/common/"
"common headers"
${header_names}
)
configure_file(
${CMAKE_CURRENT_SOURCE_DIR}/common.hpp.in
${CMAKE_CURRENT_BINARY_DIR}/common.hpp
)

# Install
install(
Expand Down
3 changes: 0 additions & 3 deletions dart/common/common.hpp.in

This file was deleted.

9 changes: 2 additions & 7 deletions dart/constraint/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,11 @@ dart_add_core_sources(${srcs} ${detail_srcs})

# Generate header for this namespace
dart_get_filename_components(header_names "constraint headers" ${hdrs})
dart_generate_include_header_list(
constraint_headers
dart_generate_include_header_file(
"${CMAKE_CURRENT_BINARY_DIR}/constraint.hpp"
"dart/constraint/"
"constraint headers"
${header_names}
)
configure_file(
${CMAKE_CURRENT_SOURCE_DIR}/constraint.hpp.in
${CMAKE_CURRENT_BINARY_DIR}/constraint.hpp
)

# Install
install(
Expand Down
3 changes: 0 additions & 3 deletions dart/constraint/constraint.hpp.in

This file was deleted.

9 changes: 2 additions & 7 deletions dart/dynamics/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,11 @@ dart_add_core_sources(${srcs} ${detail_srcs})
dart_get_filename_components(header_names "dynamics headers" ${hdrs})
# TODO: remove below line once the files are completely removed.
list(REMOVE_ITEM header_names "MultiSphereShape.hpp")
dart_generate_include_header_list(
dynamics_headers
dart_generate_include_header_file(
"${CMAKE_CURRENT_BINARY_DIR}/dynamics.hpp"
"dart/dynamics/"
"dynamics headers"
${header_names}
)
configure_file(
${CMAKE_CURRENT_SOURCE_DIR}/dynamics.hpp.in
${CMAKE_CURRENT_BINARY_DIR}/dynamics.hpp
)

# Install
install(
Expand Down
3 changes: 0 additions & 3 deletions dart/dynamics/dynamics.hpp.in

This file was deleted.

9 changes: 2 additions & 7 deletions dart/gui/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -97,16 +97,11 @@ set(
${header_names}
glut/glut.hpp
)
dart_generate_include_header_list(
gui_headers
dart_generate_include_header_file(
"${CMAKE_CURRENT_BINARY_DIR}/gui.hpp"
"dart/gui/"
"gui headers"
${header_names}
)
configure_file(
${CMAKE_CURRENT_SOURCE_DIR}/gui.hpp.in
${CMAKE_CURRENT_BINARY_DIR}/gui.hpp
)

# Install
install(
Expand Down
9 changes: 2 additions & 7 deletions dart/gui/glut/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,11 @@ dart_add_gui_sources(${srcs} ${detail_srcs})

# Generate header for this namespace
dart_get_filename_components(header_names "gui_glut_headers headers" ${hdrs})
dart_generate_include_header_list(
gui_glut_headers
dart_generate_include_header_file(
"${CMAKE_CURRENT_BINARY_DIR}/glut.hpp"
"dart/gui/glut/"
"gui_glut_headers headers"
${header_names}
)
configure_file(
${CMAKE_CURRENT_SOURCE_DIR}/glut.hpp.in
${CMAKE_CURRENT_BINARY_DIR}/glut.hpp
)

# Install
install(
Expand Down
3 changes: 0 additions & 3 deletions dart/gui/gui.hpp.in

This file was deleted.

9 changes: 2 additions & 7 deletions dart/gui/osg/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -76,16 +76,11 @@ add_component_dependencies(${PROJECT_NAME} ${component_name} gui)
# Generate header for this namespace
dart_get_filename_components(header_names "gui osg headers" ${hdrs})
list(APPEND header_names "render/render.hpp")
dart_generate_include_header_list(
gui_osg_headers
dart_generate_include_header_file(
"${CMAKE_CURRENT_BINARY_DIR}/osg.hpp"
"dart/gui/osg/"
"gui osg headers"
${header_names}
)
configure_file(
${CMAKE_CURRENT_SOURCE_DIR}/osg.hpp.in
${CMAKE_CURRENT_BINARY_DIR}/osg.hpp
)

# Install
install(
Expand Down
9 changes: 2 additions & 7 deletions dart/gui/osg/render/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,11 @@ set(dart_gui_osg_hdrs ${dart_gui_osg_hdrs} ${hdrs} PARENT_SCOPE)
set(dart_gui_osg_srcs ${dart_gui_osg_srcs} ${srcs} PARENT_SCOPE)

dart_get_filename_components(header_names "gui osg render headers" ${hdrs})
dart_generate_include_header_list(
gui_osg_render_headers
dart_generate_include_header_file(
"${CMAKE_CURRENT_BINARY_DIR}/render.hpp"
"dart/gui/osg/render/"
"gui osg render headers"
${header_names}
)
configure_file(
${CMAKE_CURRENT_SOURCE_DIR}/render.hpp.in
${CMAKE_CURRENT_BINARY_DIR}/render.hpp
)

# Install
install(
Expand Down
9 changes: 2 additions & 7 deletions dart/integration/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,11 @@ dart_add_core_sources(${srcs} ${detail_srcs})

# Generate header for this namespace
dart_get_filename_components(header_names "integration headers" ${hdrs})
dart_generate_include_header_list(
integration_headers
dart_generate_include_header_file(
"${CMAKE_CURRENT_BINARY_DIR}/integration.hpp"
"dart/integration/"
"integration headers"
${header_names}
)
configure_file(
${CMAKE_CURRENT_SOURCE_DIR}/integration.hpp.in
${CMAKE_CURRENT_BINARY_DIR}/integration.hpp
)

# Install
install(
Expand Down
3 changes: 0 additions & 3 deletions dart/integration/integration.hpp.in

This file was deleted.

9 changes: 2 additions & 7 deletions dart/lcpsolver/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,11 @@ dart_add_core_sources(${srcs})

# Generate header for this namespace
dart_get_filename_components(header_names "lcpsolver headers" ${hdrs})
dart_generate_include_header_list(
lcpsolver_headers
dart_generate_include_header_file(
"${CMAKE_CURRENT_BINARY_DIR}/lcpsolver.hpp"
"dart/lcpsolver/"
"lcpsolver headers"
${header_names}
)
configure_file(
${CMAKE_CURRENT_SOURCE_DIR}/lcpsolver.hpp.in
${CMAKE_CURRENT_BINARY_DIR}/lcpsolver.hpp
)

# Install
install(
Expand Down
3 changes: 0 additions & 3 deletions dart/lcpsolver/lcpsolver.hpp.in

This file was deleted.

9 changes: 2 additions & 7 deletions dart/math/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,11 @@ dart_add_core_sources(${srcs} ${detail_srcs})

# Generate header for this namespace
dart_get_filename_components(header_names "math headers" ${hdrs})
dart_generate_include_header_list(
math_headers
dart_generate_include_header_file(
"${CMAKE_CURRENT_BINARY_DIR}/math.hpp"
"dart/math/"
"math headers"
${header_names}
)
configure_file(
${CMAKE_CURRENT_SOURCE_DIR}/math.hpp.in
${CMAKE_CURRENT_BINARY_DIR}/math.hpp
)

# Install
install(
Expand Down
3 changes: 0 additions & 3 deletions dart/math/math.hpp.in

This file was deleted.

9 changes: 2 additions & 7 deletions dart/optimizer/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,11 @@ dart_add_core_sources(${srcs} ${detail_srcs})

# Generate header for this namespace
dart_get_filename_components(header_names "optimizer headers" ${hdrs})
dart_generate_include_header_list(
optimizer_headers
dart_generate_include_header_file(
"${CMAKE_CURRENT_BINARY_DIR}/optimizer.hpp"
"dart/optimizer/"
"optimizer headers"
${header_names}
)
configure_file(
${CMAKE_CURRENT_SOURCE_DIR}/optimizer.hpp.in
${CMAKE_CURRENT_BINARY_DIR}/optimizer.hpp
)

# Install
install(
Expand Down
Loading