Browse Source

BundleUtilities: Fix handling of multiple RPATHs from OS X otool

The `otool` command may return multiple RPATH entires, so call
`gp_append_unique` for each one.  Otherwise we may try to ask
`install_name_tool` to deal with the same entry twice.
Emilie Harquel 10 years ago
parent
commit
a479d7a0ae
1 changed files with 3 additions and 1 deletions
  1. 3 1
      Modules/BundleUtilities.cmake

+ 3 - 1
Modules/BundleUtilities.cmake

@@ -424,7 +424,9 @@ function(get_item_rpaths item rpaths_var)
     string(REGEX MATCHALL "rpath [^\n]+" load_cmds_ov "${load_cmds_ov}")
     string(REGEX REPLACE "rpath " "" load_cmds_ov "${load_cmds_ov}")
     if(load_cmds_ov)
-      gp_append_unique(${rpaths_var} "${load_cmds_ov}")
+      foreach(rpath ${load_cmds_ov})
+        gp_append_unique(${rpaths_var} "${rpath}")
+      endforeach()
     endif()
   endif()