Skip to content

Commit

Permalink
Support new target export template introduced with CMake 3.24 (#395)
Browse files Browse the repository at this point in the history
Signed-off-by: Timo Röhling <[email protected]>
  • Loading branch information
roehling authored Aug 11, 2022
1 parent 65a3ad5 commit ca8c26e
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ if(NOT _exported_targets STREQUAL "")
include("${_export_file}")

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

Expand Down

0 comments on commit ca8c26e

Please sign in to comment.