fix(build): number of core detection on OSX

Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
This commit is contained in:
Leonardo de Moura 2014-07-21 20:07:11 -07:00
parent 77537d43a3
commit 725f370e59

View file

@ -281,12 +281,8 @@ if(NOT DEFINED PROCESSOR_COUNT)
# Mac:
if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
find_program(cmd_sys_pro "system_profiler")
if(cmd_sys_pro)
execute_process(COMMAND ${cmd_sys_pro} OUTPUT_VARIABLE info)
string(REGEX REPLACE "^.*Total Number Of Cores: ([0-9]+).*$" "\\1"
PROCESSOR_COUNT "${info}")
endif()
execute_process(COMMAND "sysctl" "hw.ncpu" OUTPUT_VARIABLE info)
string(REGEX REPLACE "^hw.ncpu: ([0-9]+).*$" "\\1" PROCESSOR_COUNT "${info}")
endif()
# Windows: