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
[ ] Signed all commits for DCO
[ ] Added tests
[ ] Updated documentation (as needed)
[ ] Updated migration guide (as needed)
[ ] Consider updating Python bindings (if the library has them)
[ ] While waiting for a review on your PR, please help review another open pull request to support the maintainers
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.
🦟 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 thecolcon build
phase, and thenmake test
is called during thecolcon 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
codecheck
passed (See contributing)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.