Skip to content

Commit

Permalink
Add option to exclude packages in ament_execute_extensions: (#165)
Browse files Browse the repository at this point in the history
- This provides a mechanism for 'ament-auto' packages to have
their own exclude options

Signed-off-by: Juan Pablo Samper <jp.samper@apex.ai>
  • Loading branch information
jpsamper2009 authored and dirk-thomas committed Apr 5, 2019
1 parent 71487e7 commit b6a5a35
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions ament_cmake_core/cmake/core/ament_execute_extensions.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,17 @@
#
# :param extension_point: the name of the extension point
# :type extension_point: string
# :param EXCLUDE: List of packages that should be skipped
# :type EXCLUDE: list of strings
#
# @public
#
macro(ament_execute_extensions extension_point)
cmake_parse_arguments(_ARG "" "" "EXCLUDE" ${ARGN})
if(_ARG_UNPARSED_ARGUMENTS)
message(FATAL_ERROR "ament_execute_extensions() called with "
"unused arguments: ${_ARG_UNPARSED_ARGUMENTS}")
endif()
if(AMENT_EXTENSIONS_${extension_point})
foreach(_extension ${AMENT_EXTENSIONS_${extension_point}})
string(REPLACE ":" ";" _extension_list "${_extension}")
Expand All @@ -31,6 +38,9 @@ macro(ament_execute_extensions extension_point)
"name and cmake filename")
endif()
list(GET _extension_list 0 _pkg_name)
if("${_pkg_name}" IN_LIST _ARG_EXCLUDE)
continue()
endif()
list(GET _extension_list 1 _cmake_filename)
set(_extension_file "${${_pkg_name}_DIR}/${_cmake_filename}")
assert_file_exists("${_extension_file}"
Expand Down

0 comments on commit b6a5a35

Please sign in to comment.