Merge topic 'hpux-processorcount'

c3e238dd ProcessorCount: use mpsched on HPUX if machinfo is not present
This commit is contained in:
Brad King 2014-04-01 11:06:11 -04:00 committed by CMake Topic Stage
commit 8617de566f
1 changed files with 12 additions and 0 deletions

View File

@ -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()