From 59c3695edd8795b9c3b8eb7cacd3991b6a9860f6 Mon Sep 17 00:00:00 2001
From: Brad King <brad.king@kitware.com>
Date: Thu, 7 Aug 2014 11:25:36 -0400
Subject: CMP0047: Fix CMAKE_COMPILER_IS_GNU(CC|CXX) in OLD behavior

The implementation of CMP0047 detects the QNX compiler id internally,
then changes it to GNU after the language is fully enabled.  This is too
late to correctly set the old IS_GNU variables, so set them as part of
the policy OLD behavior.

Reported-by: Mike Lattanzio <mlattanzio@blackberry.com>
---
 Source/cmGlobalGenerator.cxx | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx
index beb10da..203735a 100644
--- a/Source/cmGlobalGenerator.cxx
+++ b/Source/cmGlobalGenerator.cxx
@@ -804,6 +804,14 @@ void cmGlobalGenerator::CheckCompilerIdCompatibility(cmMakefile* mf,
       case cmPolicies::OLD:
         // OLD behavior is to convert QCC to GNU.
         mf->AddDefinition(compilerIdVar.c_str(), "GNU");
+        if(lang == "C")
+          {
+          mf->AddDefinition("CMAKE_COMPILER_IS_GNUCC", "1");
+          }
+        else if(lang == "CXX")
+          {
+          mf->AddDefinition("CMAKE_COMPILER_IS_GNUCXX", "1");
+          }
         break;
       case cmPolicies::REQUIRED_IF_USED:
       case cmPolicies::REQUIRED_ALWAYS:
-- 
cgit v0.12


From 00ad505b374f80c72e6576bb0cb3829521964239 Mon Sep 17 00:00:00 2001
From: Tim Blechmann <tim@klingt.org>
Date: Thu, 7 Aug 2014 19:30:27 +0200
Subject: BundleUtilities: Allow Info.plist files which use CR line endings

Convert \r to our internal end-of-line character just as we do \n.

Signed-off-by: Tim Blechmann <tim@klingt.org>
---
 Modules/BundleUtilities.cmake | 1 +
 1 file changed, 1 insertion(+)

diff --git a/Modules/BundleUtilities.cmake b/Modules/BundleUtilities.cmake
index b896de2..60d01b5 100644
--- a/Modules/BundleUtilities.cmake
+++ b/Modules/BundleUtilities.cmake
@@ -237,6 +237,7 @@ function(get_bundle_main_executable bundle result_var)
     file(READ "${bundle}/Contents/Info.plist" info_plist)
     string(REGEX REPLACE ";" "\\\\;" info_plist "${info_plist}")
     string(REGEX REPLACE "\n" "${eol_char};" info_plist "${info_plist}")
+    string(REGEX REPLACE "\r" "${eol_char};" info_plist "${info_plist}")
 
     # Scan the lines for "<key>CFBundleExecutable</key>" - the line after that
     # is the name of the main executable.
-- 
cgit v0.12

