Browse Source

Add condition to turn off the temporary fix on CMake 2.8.12.

CMake/Xcode v2.8.12 appears to have fixed the iOS auto-linking issue. Tested on Xcode 5.
Yao Wei Tjong 姚伟忠 12 years ago
parent
commit
a93d3fbf7e
1 changed files with 4 additions and 2 deletions
  1. 4 2
      cmake_macosx.sh

+ 4 - 2
cmake_macosx.sh

@@ -34,9 +34,11 @@ cmake -E make_directory $BUILD
 # Create project with the Xcode generator
 # Create project with the Xcode generator
 cmake -E chdir $BUILD cmake -G "Xcode" $@ $SOURCE
 cmake -E chdir $BUILD cmake -G "Xcode" $@ $SOURCE
 
 
-if [ "$1" == "-DIOS=1" ]; then
-    # Due to a bug in the CMake/Xcode generator where it has wrongly assumed the IOS bundle structure to be the same as MacOSX bundle structure,
+# Temporary fix: can be removed when CMake minimum required has reached 2.8.12
+if [ "$1" == "-DIOS=1" -a -e $BUILD/CMakeScripts/XCODE_DEPEND_HELPER.make ]; then
+    # Due to a bug in the CMake/Xcode generator (prior to version 2.8.12) where it has wrongly assumed the IOS bundle structure to be the same as MacOSX bundle structure,
     # below temporary fix is required in order to solve the auto-linking issue when dependent libraries are changed
     # below temporary fix is required in order to solve the auto-linking issue when dependent libraries are changed
+    # Since version 2.8.12 CMake does not generate XCODE_DEPEND_HELPER.make script anymore, so we skip this fix when the script does not exist
     sed -i.bak 's/\/Contents\/MacOS//g' $BUILD/CMakeScripts/XCODE_DEPEND_HELPER.make
     sed -i.bak 's/\/Contents\/MacOS//g' $BUILD/CMakeScripts/XCODE_DEPEND_HELPER.make
     echo -e "\tsed -i.bak 's/\/Contents\/MacOS//g' CMakeScripts/XCODE_DEPEND_HELPER.make" >> $BUILD/CMakeScripts/ReRunCMake.make
     echo -e "\tsed -i.bak 's/\/Contents\/MacOS//g' CMakeScripts/XCODE_DEPEND_HELPER.make" >> $BUILD/CMakeScripts/ReRunCMake.make
 fi
 fi