gazebosim / gz-cmake

A set of CMake modules that are used by the C++-based Gazebo projects.
https://gazebosim.org/libs/cmake
Apache License 2.0
27 stars 31 forks source link

Disable building examples by default #377

Closed mjcarroll closed 1 year ago

mjcarroll commented 1 year ago

🦟 Bug fix

Introduced by: https://github.com/gazebosim/gz-cmake/pull/301 Fixes https://github.com/gazebosim/gz-math/issues/539

Summary

While the new cmake-native mechanism for building examples allows it to work on Windows, it also regresses on non-colcon builds.

When colcon builds run, each package is called with cmake && make && make install during the colcon build phase, and then make test is called during the colcon test phase. This guarantees that the package is installed somewhere before attempting to run the tests, which is what the examples need.

In builds like the deb-builder, this sequence is instead make && make test to verify that the package has been correctly built before creating the deb.

This PR makes building examples off by default, and can be enabled by adding -DBUILD_EXAMPLES:bool=True to the cmake args for local and CI builds.

Checklist

Note to maintainers: Remember to use Squash-Merge and edit the commit message to match the pull request summary while retaining Signed-off-by messages.

mjcarroll commented 1 year ago

As part of this, we probably want to also update documentation to reflect that a make install is needed for examples, as well as enabling this in CI.

iche033 commented 1 year ago

add a note to migration guide?

mjcarroll commented 1 year ago

Updated migration guide