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

Add possibility to pass custom cmake args to colcon build #46

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

jpbusch
Copy link
Collaborator

@jpbusch jpbusch commented Dec 23, 2024

  • new ci variable: custom-cmake-args / CUSTOM_CMAKE_ARGS
  • default: "-DCMAKE_BUILD_TYPE=Release"

lreiher
lreiher previously approved these changes Dec 23, 2024
# build ROS workspace
RUN if [[ -x "$(command -v colcon)" ]]; then \
source /opt/ros/${ROS_DISTRO}/setup.bash && \
[[ -f /opt/ws_rmw_zenoh/install/setup.bash ]] && source /opt/ws_rmw_zenoh/install/setup.bash ; \
[[ -f /opt/ws_base_image/install/setup.bash ]] && source /opt/ws_base_image/install/setup.bash ; \
colcon build --cmake-args -DCMAKE_BUILD_TYPE=Release ; \
colcon build --cmake-args ${CUSTOM_CMAKE_ARGS} ; \
Copy link
Member

Choose a reason for hiding this comment

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

What happens if set to empty string? Still valid?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Tested in minimal examples -> still valid

Copy link
Member

Choose a reason for hiding this comment

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

Rename to CMAKE_ARGS?

scripts/build.sh Outdated Show resolved Hide resolved
@akloeker
Copy link
Member

The PR should be ready now. The build_image() function had to be refactored to fix a bug with space separated arguments. As a bonus, the script is now more concise.

@akloeker akloeker marked this pull request as ready for review January 15, 2025 16:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants