diff --git a/cmake/BundleStatic.cmake b/cmake/BundleStatic.cmake index ae59b4f9e55a..299666a75707 100644 --- a/cmake/BundleStatic.cmake +++ b/cmake/BundleStatic.cmake @@ -51,11 +51,14 @@ function(bundle_static TARGET) # Repeatedly expand and flatten: T ~> T, T.INTERFACE_LINK_LIBRARIES foreach (i RANGE 5) _bundle_static_replace( - cmd "(.+)" "\\1;$<$:$>" + cmd "(.+)" "$<$:\\1;$>" ) set(cmd "$>") endforeach () + # Ensure we are only including targets + _bundle_static_replace(cmd "(.+)" "$") + # Rewrite T ~> T^T.TYPE -- we use ^ as a delimiter _bundle_static_replace(cmd "(.+)" "\\1^$") set(cmd "$")