Am Montag, 8. November 2010 schrieb David Cole:
> Hi Rolf,
> 
> Can you update to a CMake based on 'next' and try the commit I made this
> morning on a QNX machine? (based on your patch, thank you for that...)

Still needs some tweak, as the output is:

getconf: Can't find _NPROCESSORS_ONLN
ProcessorCount: using getconf '/usr/bin/getconf'
ProcessorCount: using pidin '/bin/pidin'
processor_count='1'

Patch attached.

Eike
From 4a9d6fcde4a301eee3e41f1e4c6fa7a6197892d4 Mon Sep 17 00:00:00 2001
From: Rolf Eike Beer <e...@sf-mail.de>
Date: Mon, 8 Nov 2010 19:54:41 +0100
Subject: [PATCH] catch all error messages from processes called in ProcessorCount module so they don't clutter the output

---
 Modules/ProcessorCount.cmake |    9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/Modules/ProcessorCount.cmake b/Modules/ProcessorCount.cmake
index 5c38267..ffc5a9d 100644
--- a/Modules/ProcessorCount.cmake
+++ b/Modules/ProcessorCount.cmake
@@ -38,7 +38,8 @@ function(ProcessorCount var)
     if(ProcessorCount_cmd_sysctl)
       execute_process(COMMAND ${ProcessorCount_cmd_sysctl} -n hw.ncpu
         OUTPUT_STRIP_TRAILING_WHITESPACE
-        OUTPUT_VARIABLE count)
+        OUTPUT_VARIABLE count
+        ERROR_VARIABLE trash)
       message("ProcessorCount: using sysctl '${ProcessorCount_cmd_sysctl}'")
     endif()
   else()
@@ -47,7 +48,8 @@ function(ProcessorCount var)
     if(ProcessorCount_cmd_getconf)
       execute_process(COMMAND ${ProcessorCount_cmd_getconf} _NPROCESSORS_ONLN
         OUTPUT_STRIP_TRAILING_WHITESPACE
-        OUTPUT_VARIABLE count)
+        OUTPUT_VARIABLE count
+        ERROR_VARIABLE trash)
       message("ProcessorCount: using getconf '${ProcessorCount_cmd_getconf}'")
     endif()
 
@@ -57,7 +59,8 @@ function(ProcessorCount var)
       if(ProcessorCount_cmd_pidin)
         execute_process(COMMAND ${ProcessorCount_cmd_pidin} info
           OUTPUT_STRIP_TRAILING_WHITESPACE
-          OUTPUT_VARIABLE pidin_output)
+          OUTPUT_VARIABLE pidin_output
+          ERROR_VARIABLE trash)
         string(REGEX MATCHALL "Processor[0-9]+: " procs "${pidin_output}")
         list(LENGTH procs count)
         message("ProcessorCount: using pidin '${ProcessorCount_cmd_pidin}'")
-- 
1.7.1

Attachment: signature.asc
Description: This is a digitally signed message part.

_______________________________________________
cmake-developers mailing list
cmake-developers@cmake.org
http://public.kitware.com/cgi-bin/mailman/listinfo/cmake-developers

Reply via email to