From 2b44681672ae99d68560e5907507b38c245342b0 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Johan=20Bj=C3=B6rk?= <phb@spotify.com>
Date: Mon, 7 Mar 2011 13:30:08 +0100
Subject: [PATCH 3/3] xcode: Re-add the post build phase

---
 Source/cmGlobalXCodeGenerator.cxx |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx
index 9d24672..d2a960f 100644
--- a/Source/cmGlobalXCodeGenerator.cxx
+++ b/Source/cmGlobalXCodeGenerator.cxx
@@ -1082,6 +1082,8 @@ void cmGlobalXCodeGenerator::CreateCustomCommands(cmXCodeObject* buildPhases,
     = cmtarget.GetPreBuildCommands();
   std::vector<cmCustomCommand> const & prelink
     = cmtarget.GetPreLinkCommands();
+  std::vector<cmCustomCommand> const & postbuild
+    = cmtarget.GetPostBuildCommands();
   std::vector<cmSourceFile*>const &classes = cmtarget.GetSourceFiles();
   // add all the sources
   std::vector<cmCustomCommand> commands;
@@ -1108,6 +1110,10 @@ void cmGlobalXCodeGenerator::CreateCustomCommands(cmXCodeObject* buildPhases,
   cmXCodeObject* preLinkPhase =
     this->CreateBuildPhase("CMake PreLink Rules", "preLinkCommands",
                            cmtarget, prelink);
+  // create postbuild phase
+  cmXCodeObject* postBuildPhase =
+  this->CreateBuildPhase("CMake PostBuild Rules", "postBuildPhase",
+                           cmtarget, postbuild);
 
   // create copy file phase for main executable to copy resulting
   // binary from native Xcode location to where cmake wants it
@@ -1170,6 +1176,10 @@ void cmGlobalXCodeGenerator::CreateCustomCommands(cmXCodeObject* buildPhases,
     {
     buildPhases->AddObject(frameworkBuildPhase);
     }
+  if(postBuildPhase)
+    {
+    buildPhases->AddObject(postBuildPhase);
+    }
   if(copyBuildPhase)
     {
     buildPhases->AddObject(copyBuildPhase);
-- 
1.7.2.1

