Patch CMake to avoid using faulty system header in OSX 10.10

CMake project files include CoreFoundation/CoreFoundation.h which is a collection 
of headers one of which is CoreFoundation/CFStream.h. It includes faulty header 
dispatch/dispatch.h. Since CoreFoundation/CFStream.h is not needed for CMake,
specific headers needed are included to replace CoreFoundation/CoreFoundation.h

diff -dru src/Source/cmFindProgramCommand.cxx new/Source/cmFindProgramCommand.cxx
--- src/Source/cmFindProgramCommand.cxx	2017-05-02 14:59:43.000000000 +0200
+++ new/Source/cmFindProgramCommand.cxx	2017-05-18 15:56:09.094011660 +0200
@@ -9,7 +9,7 @@
 class cmExecutionStatus;
 
 #if defined(__APPLE__)
-#include <CoreFoundation/CoreFoundation.h>
+#include <CoreFoundation/CFBundle.h>
 #endif
 
 struct cmFindProgramHelper
diff -dru src/Source/cmXCodeObject.cxx new/Source/cmXCodeObject.cxx
--- src/Source/cmXCodeObject.cxx	2017-05-02 14:59:43.000000000 +0200
+++ new/Source/cmXCodeObject.cxx	2017-05-18 15:57:35.222438748 +0200
@@ -2,7 +2,7 @@
    file Copyright.txt or https://cmake.org/licensing for details.  */
 #include "cmXCodeObject.h"
 
-#include <CoreFoundation/CoreFoundation.h>
+#include <CoreFoundation/CFUUID.h>
 #include <ostream>
 
 #include "cmSystemTools.h"
diff -dru src/Source/CPack/cmCPackDragNDropGenerator.cxx new/Source/CPack/cmCPackDragNDropGenerator.cxx
--- src/Source/CPack/cmCPackDragNDropGenerator.cxx	2017-05-02 14:59:43.000000000 +0200
+++ new/Source/CPack/cmCPackDragNDropGenerator.cxx	2017-05-18 22:00:35.917646538 +0200
@@ -12,8 +12,9 @@
 #include <iomanip>
 #include <map>
 #include <stdlib.h>
+#include <algorithm>
 
-#include <CoreFoundation/CoreFoundation.h>
+#include <CoreFoundation/CFString.h>
 
 #ifdef HAVE_CoreServices
 // For the old LocaleStringToLangAndRegionCodes() function, to convert
diff -dru src/Source/CPack/OSXScriptLauncher.cxx new/Source/CPack/OSXScriptLauncher.cxx
--- src/Source/CPack/OSXScriptLauncher.cxx	2017-05-02 14:59:43.000000000 +0200
+++ new/Source/CPack/OSXScriptLauncher.cxx	2017-05-18 16:00:45.179380694 +0200
@@ -8,7 +8,7 @@
 #include <string>
 #include <vector>
 
-#include <CoreFoundation/CoreFoundation.h>
+#include <CoreFoundation/CFBundle.h>
 
 // For the PATH_MAX constant
 #include <sys/syslimits.h>
