Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 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
16 changes: 8 additions & 8 deletions vendor/backward-cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -157,16 +157,16 @@ if(BACKWARD_TESTS)
endforeach()
endif()

install(
FILES "backward.hpp"
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
)
install(
FILES "BackwardConfig.cmake"
DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}"
)
# check if Backward is being used as a top-level project or included as a subproject
if(CMAKE_SOURCE_DIR STREQUAL PROJECT_SOURCE_DIR)
install(

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If I undesrtand this correctly, this would still install the header since it's being included as a subproject in our top level CMakeLists.txt file

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CMAKE_SOURCE_DIR should equal to the root of the gz-sim repository while PROJECT_SOURCE_DIR should be equal to the vendor/backwards-cpp subdirectory on top of the root of the gz-sim repository. So we are using it but the file is not a top-level project.

@arjo129 arjo129 Sep 18, 2025

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While the logic make sense, why not completely remove it since we are patching this already?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@j-rivero, I agree. It would be simpler to remove the install calls.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok, eb7b252

FILES "backward.hpp"
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
)
install(
FILES "BackwardConfig.cmake"
DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}"
)
# export the targets (note that exporting backward_object does not make sense)
install(TARGETS backward_interface backward EXPORT BackwardTargets)
# install a CMake file for the exported targets
Expand Down
38 changes: 38 additions & 0 deletions vendor/backward-cpp/GAZEBO_MODIFIED_CODE.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
Summary: avoid installing backwards file in the system unless being
used as a top level

Description: do not install backwards files in the Gazebo usage of
the vendor package. See https://github.com/gazebosim/gz-sim/pull/2838.
Upstream PR related: https://github.com/bombela/backward-cpp/pull/338

On updates, be sure of preserving this patch.

diff --git a/vendor/backward-cpp/CMakeLists.txt b/vendor/backward-cpp/CMakeLists.txt
index e625f8ac9..3b18476d5 100644
--- a/vendor/backward-cpp/CMakeLists.txt
+++ b/vendor/backward-cpp/CMakeLists.txt
@@ -157,16 +157,16 @@ if(BACKWARD_TESTS)
endforeach()
endif()

-install(
- FILES "backward.hpp"
- DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
-)
-install(
- FILES "BackwardConfig.cmake"
- DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}"
-)
# check if Backward is being used as a top-level project or included as a subproject
if(CMAKE_SOURCE_DIR STREQUAL PROJECT_SOURCE_DIR)
+ install(
+ FILES "backward.hpp"
+ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
+ )
+ install(
+ FILES "BackwardConfig.cmake"
+ DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}"
+ )
# export the targets (note that exporting backward_object does not make sense)
install(TARGETS backward_interface backward EXPORT BackwardTargets)
# install a CMake file for the exported targets
Loading