From 9c9bc71256000c8bedd391e049150b6a0f3b0dc3 Mon Sep 17 00:00:00 2001
From: Brad King <brad.king@kitware.com>
Date: Wed, 14 Jan 2015 10:28:59 -0500
Subject: [PATCH] QNX: Fix detection of QCC compiler id (#15349)

In commit v3.1.0-rc1~113^2 (Use a more reliable regex for extracting
binary INFO strings, 2014-09-03) the matching of INFO: strings was made
more strict and no longer matches just "INFO:qnxnto".  Use
"INFO:qnxnto[]" instead to conform to the new pattern.
---
 Modules/CMakeCCompilerId.c.in          | 2 +-
 Modules/CMakeCXXCompilerId.cpp.in      | 2 +-
 Modules/CMakeDetermineCompilerId.cmake | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/Modules/CMakeCCompilerId.c.in b/Modules/CMakeCCompilerId.c.in
index 0221cbd46..09ae50936 100644
--- a/Modules/CMakeCCompilerId.c.in
+++ b/Modules/CMakeCCompilerId.c.in
@@ -18,7 +18,7 @@ char const* info_simulate = "INFO" ":" "simulate[" SIMULATE_ID "]";
 #endif
 
 #ifdef __QNXNTO__
-char const* qnxnto = "INFO" ":" "qnxnto";
+char const* qnxnto = "INFO" ":" "qnxnto[]";
 #endif
 
 @CMAKE_C_COMPILER_ID_PLATFORM_CONTENT@
diff --git a/Modules/CMakeCXXCompilerId.cpp.in b/Modules/CMakeCXXCompilerId.cpp.in
index 9ece26def..cc3ab49ab 100644
--- a/Modules/CMakeCXXCompilerId.cpp.in
+++ b/Modules/CMakeCXXCompilerId.cpp.in
@@ -17,7 +17,7 @@ char const* info_simulate = "INFO" ":" "simulate[" SIMULATE_ID "]";
 #endif
 
 #ifdef __QNXNTO__
-char const* qnxnto = "INFO" ":" "qnxnto";
+char const* qnxnto = "INFO" ":" "qnxnto[]";
 #endif
 
 @CMAKE_CXX_COMPILER_ID_PLATFORM_CONTENT@
diff --git a/Modules/CMakeDetermineCompilerId.cmake b/Modules/CMakeDetermineCompilerId.cmake
index 6c6a91483..9f92cd066 100644
--- a/Modules/CMakeDetermineCompilerId.cmake
+++ b/Modules/CMakeDetermineCompilerId.cmake
@@ -445,7 +445,7 @@ function(CMAKE_DETERMINE_COMPILER_ID_CHECK lang file)
         string(REGEX REPLACE "^0+([0-9])" "\\1" SIMULATE_VERSION "${CMAKE_MATCH_1}")
         string(REGEX REPLACE "\\.0+([0-9])" ".\\1" SIMULATE_VERSION "${SIMULATE_VERSION}")
       endif()
-      if("${info}" MATCHES "INFO:qnxnto")
+      if("${info}" MATCHES "INFO:qnxnto\\[\\]")
         set(COMPILER_QNXNTO 1)
       endif()
     endforeach()