    find_package(FFmpeg)
  endif()
  
-@@ -266,7 +259,6 @@ if(WITH_BOOST)
+@@ -267,7 +260,6 @@ if(WITH_BOOST)
  endif()
  
  if(WITH_INTERNATIONAL OR WITH_CODEC_FFMPEG)
--  set(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} -liconv") # boost_locale and ffmpeg needs it !
+-  string(APPEND PLATFORM_LINKFLAGS " -liconv") # boost_locale and ffmpeg needs it !
  endif()
  
- if(WITH_OPENIMAGEIO)
-@@ -439,7 +431,7 @@ else()
+ if(WITH_PUGIXML)
+@@ -451,7 +443,7 @@ else()
    set(CMAKE_CXX_FLAGS_RELEASE "-O2 -mdynamic-no-pic")
  endif()
  
 -if(${XCODE_VERSION} VERSION_EQUAL 5 OR ${XCODE_VERSION} VERSION_GREATER 5)
 +if(FALSE)
    # Xcode 5 is always using CLANG, which has too low template depth of 128 for libmv
-   set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -ftemplate-depth=1024")
+   string(APPEND CMAKE_CXX_FLAGS " -ftemplate-depth=1024")
  endif()

   )
 
   print_found_status("SndFile libraries" "${LIBSNDFILE_LIBRARIES}")
@@ -132,7 +127,7 @@ if(WITH_PYTHON)
     # normally cached but not since we include them with blender
     set(PYTHON_INCLUDE_DIR "${LIBDIR}/python/include/python${PYTHON_VERSION}m")
     set(PYTHON_EXECUTABLE "${LIBDIR}/python/bin/python${PYTHON_VERSION}m")

     set(PYTHON_LIBPATH "${LIBDIR}/python/lib/python${PYTHON_VERSION}")
     # set(PYTHON_LINKFLAGS "-u _PyMac_Error")  # won't  build with this enabled
   else()
@@ -174,9 +169,7 @@ endif()
 if(WITH_CODEC_FFMPEG)
   set(FFMPEG_FIND_COMPONENTS
     avcodec avdevice avformat avutil
