summaryrefslogtreecommitdiffstats
path: root/Modules/ProcessorCount.cmake
diff options
context:
space:
mode:
authorRolf Eike Beer <eike@sf-mail.de>2014-03-28 16:59:31 (GMT)
committerRolf Eike Beer <eike@sf-mail.de>2014-03-28 17:02:49 (GMT)
commitc3e238dd538322268a4475ac4454b35fe39a134e (patch)
tree0e6f8e4995920aca8c1d4450bc2328769f210fb7 /Modules/ProcessorCount.cmake
parentcab2e31443a38b1023ec46eb99759a4be941fea0 (diff)
downloadCMake-c3e238dd538322268a4475ac4454b35fe39a134e.zip
CMake-c3e238dd538322268a4475ac4454b35fe39a134e.tar.gz
CMake-c3e238dd538322268a4475ac4454b35fe39a134e.tar.bz2
ProcessorCount: use mpsched on HPUX if machinfo is not present
Co-Author: Gerhard Grimm <gerhard.grimm@detec.com>
Diffstat (limited to 'Modules/ProcessorCount.cmake')
-rw-r--r--Modules/ProcessorCount.cmake12
1 files changed, 12 insertions, 0 deletions
diff --git a/Modules/ProcessorCount.cmake b/Modules/ProcessorCount.cmake
index 0fe0b32..e034a28 100644
--- a/Modules/ProcessorCount.cmake
+++ b/Modules/ProcessorCount.cmake
@@ -104,6 +104,18 @@ function(ProcessorCount var)
string(REGEX MATCHALL "Number of CPUs = ([0-9]+)" procs "${machinfo_output}")
set(count "${CMAKE_MATCH_1}")
#message("ProcessorCount: trying machinfo '${ProcessorCount_cmd_machinfo}'")
+ else()
+ find_program(ProcessorCount_cmd_mpsched mpsched)
+ mark_as_advanced(ProcessorCount_cmd_mpsched)
+ if(ProcessorCount_cmd_mpsched)
+ execute_process(COMMAND ${ProcessorCount_cmd_mpsched} -s
+ OUTPUT_QUIET
+ ERROR_STRIP_TRAILING_WHITESPACE
+ ERROR_VARIABLE mpsched_output)
+ string(REGEX MATCHALL "Processor Count *: *([0-9]+)" procs "${mpsched_output}")
+ set(count "${CMAKE_MATCH_1}")
+ #message("ProcessorCount: trying mpsched -s '${ProcessorCount_cmd_mpsched}'")
+ endif()
endif()
endif()