Skip to content

Commit ca8c26e

Browse files
authored
Support new target export template introduced with CMake 3.24 (#395)
Signed-off-by: Timo Röhling <[email protected]>
1 parent 65a3ad5 commit ca8c26e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

ament_cmake_export_targets/cmake/ament_cmake_export_targets-extras.cmake.in

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ if(NOT _exported_targets STREQUAL "")
99
include("${_export_file}")
1010

1111
# extract the target names associated with the export
12-
set(_regex "foreach\\(_expectedTarget (.+)\\)")
12+
set(_regex "foreach\\((_cmake)?_expected_?[Tt]arget (IN ITEMS )?(.+)\\)")
1313
file(
1414
STRINGS "${_export_file}" _foreach_targets
1515
REGEX "${_regex}")
@@ -18,7 +18,7 @@ if(NOT _exported_targets STREQUAL "")
1818
message(FATAL_ERROR
1919
"Failed to find exported target names in '${_export_file}'")
2020
endif()
21-
string(REGEX REPLACE "${_regex}" "\\1" _targets "${_foreach_targets}")
21+
string(REGEX REPLACE "${_regex}" "\\3" _targets "${_foreach_targets}")
2222
string(REPLACE " " ";" _targets "${_targets}")
2323
list(LENGTH _targets _length)
2424

0 commit comments

Comments
 (0)