summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2019-08-21 14:50:06 (GMT)
committerKitware Robot <kwrobot@kitware.com>2019-08-21 14:51:48 (GMT)
commit2ad09c5ddd133bc4e543b15eb5e75b6e0aaaf197 (patch)
tree1c30391ab8c4ae45ee823c0d19e97eb7a4419397 /Modules
parente15a9187b04336b64c92bde0a6b879237193ac5f (diff)
parent1c87bc60eef7de896215b0b8a2d0e0abf411f113 (diff)
downloadCMake-2ad09c5ddd133bc4e543b15eb5e75b6e0aaaf197.zip
CMake-2ad09c5ddd133bc4e543b15eb5e75b6e0aaaf197.tar.gz
CMake-2ad09c5ddd133bc4e543b15eb5e75b6e0aaaf197.tar.bz2
Merge topic 'ProcessorCount-solaris'
1c87bc60ee ProcessorCount: Fix virtual processor count on Solaris Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !3694
Diffstat (limited to 'Modules')
-rw-r--r--Modules/ProcessorCount.cmake10
1 files changed, 7 insertions, 3 deletions
diff --git a/Modules/ProcessorCount.cmake b/Modules/ProcessorCount.cmake
index 8c25256..43ec889 100644
--- a/Modules/ProcessorCount.cmake
+++ b/Modules/ProcessorCount.cmake
@@ -168,9 +168,13 @@ function(ProcessorCount var)
ERROR_QUIET
OUTPUT_STRIP_TRAILING_WHITESPACE
OUTPUT_VARIABLE psrinfo_output)
- string(REGEX MATCH "([0-9]+) virtual processor" procs "${psrinfo_output}")
- set(count "${CMAKE_MATCH_1}")
- #message("ProcessorCount: trying psrinfo -p -v '${ProcessorCount_cmd_prvinfo}'")
+ string(REGEX MATCHALL "has [0-9]+ virtual processor" procs "${psrinfo_output}")
+ set(count "")
+ foreach(proc ${procs})
+ string(REGEX MATCH "has ([0-9]+) virtual" res ${proc})
+ math(EXPR count "${count} + ${CMAKE_MATCH_1}")
+ endforeach()
+ #message("ProcessorCount: trying '${ProcessorCount_cmd_psrinfo}' -p -v")
else()
# Sun (systems where uname -X emits "NumCPU" in its output):
find_program(ProcessorCount_cmd_uname uname)