I have build a Universal apps ... now i take script from http://qtnode.net/wiki/Distributing_Mac_Qt_applications

i set my path and install_name_tool not relink correct the new libs inside apps ...

if i rename my local /Library/Frameworks/QtCore.framework the apps not take libs from new set install_name_tool why?? wo is mistake?

Qt Code:
  1. #!/bin/bash
  2. #
  3. # Configuration start
  4. #
  5.  
  6. # relative path to the directory which contains the created app bundle
  7. BIN_DIR="bin"
  8. # name of the binary
  9. BINARY_NAME="edithtml"
  10. # Qt libraries you've linked against on apps remove not needed libs
  11. declare -a NEEDED_LIBS=( "QtCore" "QtGui" "QtXml" "QtSql" "QtNetwork" "QtOpenGL" "QtSvg")
  12. # additional files you'd like to get copied to the final dmg
  13. declare -a ADD_FILES=("bin/ticket.pdf" "bin/copying.txt")
  14.  
  15. #
  16. # Configuration end, nothing should be edited from here on
  17. #
  18. # on main.cpp
  19. #if defined Q_WS_MAC
  20. #QStringList path;
  21. #path.append(QApplication::applicationDirPath());
  22. #QDir dir(QApplication::applicationDirPath());
  23. #dir.cdUp();
  24. #path.append(dir.absolutePath());
  25. #dir.cd("plugins");
  26. #path.append(dir.absolutePath());
  27. #dir.cdUp();
  28. #path.append(dir.absolutePath());
  29. #QApplication::setLibraryPaths(path);
  30. #QDir::setCurrent(dir.absolutePath()); /* here down -> Frameworks */
  31. #endif
  32.  
  33.  
  34. qtbaselibpath="/Library/Frameworks"
  35. bundle_dir="$BIN_DIR/$BINARY_NAME.app"
  36. bundle_bin="$bundle_dir/Contents/MacOS/$BINARY_NAME"
  37. framework_dir="$bundle_dir/Contents/Frameworks"
  38. plugin_dir="$bundle_dir/Contents/plugins"
  39. locale_dir="$bundle_dir/Contents/locale"
  40.  
  41.  
  42.  
  43.  
  44. if [ ! -d "$bundle_dir" ]; then
  45. echo "Application bundle not found in bin... exiting."
  46. exit 1
  47. fi
  48.  
  49. echo "Creating Frameworks directory in application bundle..."
  50. mkdir -p "$framework_dir"
  51. mkdir -p $plugin_dir
  52. mkdir -p $locale_dir
  53.  
  54. libcount=${#NEEDED_LIBS[@]}
  55. for (( i = 0 ; i < libcount ; i++ ))
  56. do
  57. lib=${NEEDED_LIBS[$i]}
  58. echo "Processing $lib..."
  59.  
  60. if [ ! -d "$qtbaselibpath/$lib.framework" ]; then
  61. echo "Couldn't find $lib.framework in $qtbaselibpath."
  62. exit 1
  63. fi
  64.  
  65.  
  66. rm -rf "$framework_dir/$lib.framework"
  67. cp -fR "$qtbaselibpath/$lib.framework" "$framework_dir"
  68. echo "...$lib copied."
  69.  
  70. install_name_tool \
  71. -id "@executable_path/../Frameworks/$lib.framework/Versions/4/$lib" \
  72. "$framework_dir/$lib.framework/Versions/4/$lib"
  73.  
  74. # other Qt libs depend at least on QtCore
  75. if [ "$lib" != "QtCore" ]; then
  76. install_name_tool -change "$qtbaselibpath/QtCore.framework/Versions/4/QtCore" \
  77. "@executable_path/../Frameworks/QtCore.framework/Versions/4/QtCore" \
  78. "$framework_dir/$lib.framework/Versions/Current/$lib"
  79. fi
  80.  
  81. install_name_tool -change "$qtbaselibpath/$lib.framework/Versions/4/$lib" \
  82. "@executable_path/../Frameworks/$lib.framework/Versions/4/$lib" \
  83. "$bundle_bin"
  84.  
  85. echo "...$lib done."
  86. done
  87.  
  88.  
  89. echo "Removing any debug libraries and headers..."
  90. find "$framework_dir" | egrep "debug|Headers" | xargs rm -rf
  91.  
  92. echo "Preparing image directory..."
  93. tempdir="/tmp/`basename $0`.$$"
  94. mkdir $tempdir
  95. cp -R $bundle_dir $tempdir
  96. echo "...Bundle copied"
  97. fcount=${#ADD_FILES[@]}
  98. for (( i = 0 ; i < fcount ; i++ )) do
  99. file=${ADD_FILES[$i]}
  100. if [ ! -f "$file" ]; then
  101. echo "WARNING: $file not found!"
  102. else
  103. cp "$file" $tempdir
  104. echo "...$file copied"
  105. fi
  106. done
  107. echo "Creating disk image..."
  108. rm -f "$BIN_DIR/$BINARY_NAME.dmg"
  109. # format UDBZ: bzip2 compressed (10.4+), UDZ0: zlib compressed (default)
  110. hdiutil create -srcfolder $tempdir -format UDBZ -volname "$BINARY_NAME" "$BIN_DIR/$BINARY_NAME.dmg"
  111. rm -rf $tempdir
To copy to clipboard, switch view to plain text mode