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

ament_vendor: Add AMENT_VENDOR_NEVER_VENDOR #552

Open
wants to merge 2 commits into
base: rolling
Choose a base branch
from
Open
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
20 changes: 20 additions & 0 deletions ament_cmake_vendor_package/cmake/ament_vendor.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,14 @@
# projects.
# :type GLOBAL_HOOK: option
#
# Beside CMake macro options, the macro is also influenced by the following two
# CMake options, that can be set at the CMake invocation for the project that
# uses ament_vendor() macro:
# * `FORCE_BUILD_VENDOR_PKG`: If ON build vendor packages from source, even if
# system-installed packages are available
# * `AMENT_VENDOR_NEVER_VENDOR`: If ON, raise an error if SATISFIED argument is
# not true instead of building the vendored package
#
# @public
#
macro(ament_vendor TARGET_NAME)
Expand Down Expand Up @@ -97,6 +105,18 @@ macro(ament_vendor TARGET_NAME)
"Build vendor packages from source, even if system-installed packages are available"
OFF)

option(AMENT_VENDOR_NEVER_VENDOR
"If ON, raise an error if SATISFIED argument is not true instead of building the vendored package"
OFF)

if(FORCE_BUILD_VENDOR_PKG AND AMENT_VENDOR_NEVER_VENDOR)
message(FATAL_ERROR "ament_vendor() cannot have both FORCE_BUILD_VENDOR_PKG and AMENT_VENDOR_NEVER_VENDOR options enabled")
endif()

if(NOT _ARG_SATISFIED AND AMENT_VENDOR_NEVER_VENDOR)
message(FATAL_ERROR "ament_vendor() SATISFIED option is OFF and AMENT_VENDOR_NEVER_VENDOR is ON")
endif()

if(NOT _ARG_SATISFIED OR FORCE_BUILD_VENDOR_PKG)
if(_ARG_SATISFIED)
message(STATUS "Forcing vendor package build for '${TARGET_NAME}', which is already satisfied")
Expand Down